2 -- Tries to load known libraries
3 for _, t in ipairs { "lxp", "luasql.postgres", "luasql.mysql", "luasql.oci8", "luasql.sqlite", "luasql.odbc", "socket", "xmlrpc", "soap", "lualdap", "logging", "md5", "zip", "stable", "copas", } do
7 libraries = { "lxp", "luasql", "socket", "xmlrpc", "soap", "lualdap", "logging", "md5", "zip", "stable", "copas", }
9 local colors = { "#999999", "#CCCCCC", "#FFFFFF", }
11 function color () i = math.mod (i + 1, 3) return colors[i + 1] end
13 function pack_name (p) return string.gsub (p, "^([^.]+).-", "%1") end
15 function idx (t, f) return _G[t][f] or _G[t]["_"..f] or "" end
18 <head><title>CGILua installation overview</title></head>
20 <body bgcolor="#FFFFFF">
21 <h1>CGILua installation overview</h1>
25 <th bgcolor="#999999">Version
26 <th bgcolor="#999999">Copyright
27 <th bgcolor="#999999">Description
31 { "Lua", "_VERSION" },
32 { "compat-5.1", "_COMPAT51" },
34 for _, l in ipairs (support) do bg = color()
37 <td bgcolor = "<%= bg %>"><%= tostring(_G[l[2]]) %>
38 <td bgcolor = "<%= bg %>">
39 <td bgcolor = "<%= bg %>">
42 <tr><td colspan="4"></tr>
45 for i, p in ipairs (libraries) do
47 local n = pack_name(p)
48 if type(_G[n]) == "table" and _G[n]._VERSION then
50 table.insert (pack, n)
54 for _, p in ipairs (pack) do bg = color() ?>
56 <td bgcolor = "<%= bg %>"><%= idx(p,"VERSION") %>
57 <td bgcolor = "<%= bg %>"><small><%= idx(p,"COPYRIGHT") %></small>
58 <td bgcolor = "<%= bg %>"><small><%= idx(p,"DESCRIPTION") %></small>