Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Etiene/sailor
Browse files Browse the repository at this point in the history
  • Loading branch information
Etiene committed Oct 9, 2015
2 parents 5e0158d + 495e16e commit f3e0f7e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
11 changes: 1 addition & 10 deletions src/sailor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ function sailor.launch(native_request)
-- Apache with CGILua or mod_pLua
httpd = remy.httpd
sailor.remy_mode = remy.init(sailor.remy_mode, native_request)
if sailor.remy_mode == remy.MODE_LIGHTTPD then
-- FIXME: os.tmpname(), used by web_utils\utils.lua not
-- working in LightTPD (affects Windows build only?)
-- This breaks every script using "session"
function os.tmpname()
return 'tmp'
end
end
remy.contentheader('text/html')
remy.run(sailor.handle_request)
end
Expand All @@ -63,8 +55,7 @@ end

-- Stores the path of the application in sailor.path
function sailor.set_application_path(r)
if sailor.remy_mode == remy.MODE_LIGHTTPD then
-- Ideally, this should not be needed (needs improvement/removal)
if sailor.remy_mode ~= nil then
sailor.path = sailor.get_filename_path(r)
else
local dir = lfs.currentdir()
Expand Down
9 changes: 8 additions & 1 deletion src/sailor/blank-app/index-magnet.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Alternative index for LightTPD's mod_magnet
-- Alternative index and launcher for LightTPD's mod_magnet
if lighty ~= nil then
-- Note: package.loaded.lighty ~= nil will not work because lighty is a
-- local variable and not a package
Expand All @@ -7,6 +7,13 @@ if lighty ~= nil then
package.cpath = package.cpath..";"..docroot.."/../lib/clibs/?.dll"
package.path = package.path..";"..docroot.."/sailor/?.lua"

-- FIXME: os.tmpname(), used by web_utils\utils.lua not
-- working in LightTPD (affects Windows build only?)
-- This breaks every script using "session"
function os.tmpname()
return 'tmp'
end

-- Makes lighty global so it can be accessed by Remy or controllers
_G["lighty"] = lighty
local sailor = require "sailor"
Expand Down
9 changes: 8 additions & 1 deletion test/dev-app/index-magnet.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Alternative index for LightTPD's mod_magnet
-- Alternative index and launcher for LightTPD's mod_magnet
if lighty ~= nil then
-- Note: package.loaded.lighty ~= nil will not work because lighty is a
-- local variable and not a package
Expand All @@ -7,6 +7,13 @@ if lighty ~= nil then
package.cpath = package.cpath..";"..docroot.."/../lib/clibs/?.dll"
package.path = package.path..";"..docroot.."/sailor/?.lua"

-- FIXME: os.tmpname(), used by web_utils\utils.lua not
-- working in LightTPD (affects Windows build only?)
-- This breaks every script using "session"
function os.tmpname()
return 'tmp'
end

-- Makes lighty global so it can be accessed by Remy or controllers
_G["lighty"] = lighty
local sailor = require "sailor"
Expand Down

0 comments on commit f3e0f7e

Please sign in to comment.