---------------------------------------------------------------------------- -- Main Lua script. -- It executes the requested Lua script. -- -- $Id: t_mod2.lua,v 1.8 2006/08/10 19:28:02 mascarenhas Exp $ ---------------------------------------------------------------------------- -- Kepler bootstrap local bootstrap, err = loadfile(os.getenv("KEPLER_INIT") or [[KEPLER_INIT]]) if bootstrap then bootstrap() else apache2.log_error(arg[1], tostring(err), "error") return apache2.OK end require"apache2" require"rings" local s = rings.new () local ok, ret = s:dostring ([[ -- Kepler bootstrap dofile(os.getenv("KEPLER_INIT")) local info = require"sapi.mod2.info" local req = require"sapi.mod2.request" local res = require"sapi.mod2.response" SAPI = { Info = info.open (arg[1]), Request = req.open (arg[1]), Response = res.open (arg[1]), } require"cgilua" return cgilua.main () ]], arg[1]) s:close () if ok and type(ret) == "number" then return ret elseif not ok and ret then apache2.log_error (arg[1], tostring(ret), "error") end return apache2.OK