4 <head><title>Script Lua Test</title></head>
10 for i,v in pairs (cgi) do
11 if type(v) == "table" then
13 for a,b in pairs(v) do
14 vv = string.format ("%s%s = %s<br>\n", vv, a, tostring(b))
18 cgilua.put (string.format ("%s = %s<br>\n", i, tostring(v)))
21 cgilua.put ("Remote address: "..cgilua.servervariable"REMOTE_ADDR")
23 cgilua.put ("Is persistent = "..tostring (SAPI.Info.ispersistent).."<br>\n")
24 cgilua.put ("ap="..tostring(ap).."<br>\n")
25 cgilua.put ("lfcgi="..tostring(lfcgi).."<br>\n")
27 -- Checking Virtual Environment
28 local my_output = cgilua.put
30 local status, err = pcall (function ()
31 assert (cgilua.put == nil, "cannot change cgilua.put value")
33 cgilua.put = my_output
34 assert (status == true, err)
37 local status, err = pcall (function () require"unknown_module" end)
38 assert (status == false, "<tt>unknown_module</tt> loaded!")
39 -- assert (package == nil, "Access to <tt>package</tt> table allowed!")