webmcp
diff framework/cgi-bin/webmcp.lua @ 64:3d43a5cf17c1
Compatibility with Lua 5.2
author | jbe |
---|---|
date | Sun Apr 15 16:04:33 2012 +0200 (2012-04-15) |
parents | 382f042d99a3 |
children | a54cc7dcabf1 |
line diff
1.1 --- a/framework/cgi-bin/webmcp.lua Tue Apr 03 00:56:02 2012 +0200 1.2 +++ b/framework/cgi-bin/webmcp.lua Sun Apr 15 16:04:33 2012 +0200 1.3 @@ -1,6 +1,11 @@ 1.4 #!/usr/bin/env lua 1.5 1.6 -_WEBMCP_VERSION = "1.1.3" 1.7 +_WEBMCP_VERSION = "1.1.4" 1.8 + 1.9 +-- Lua 5.1 compatibility 1.10 +if not table.unpack then 1.11 + table.unpack = unpack 1.12 +end 1.13 1.14 -- include "../lib/" in search path for libraries 1.15 if not WEBMCP_PATH then 1.16 @@ -27,13 +32,13 @@ 1.17 1.18 -- load os extensions for lua 1.19 -- (should happen as soon as possible due to run time measurement) 1.20 -require 'extos' 1.21 +extos = require 'extos' 1.22 1.23 -- load nihil library 1.24 -require 'nihil' 1.25 +nihil = require 'nihil' 1.26 1.27 -- load random generator library 1.28 -require 'multirand' 1.29 +multirand = require 'multirand' 1.30 1.31 -- load rocketcgi library and map it to cgi 1.32 do 1.33 @@ -41,17 +46,17 @@ 1.34 if option and option ~= "" and option ~= "0" then 1.35 cgi = nil 1.36 else 1.37 - require 'rocketcgi' 1.38 + rocketcgi = require 'rocketcgi' 1.39 cgi = rocketcgi 1.40 end 1.41 end 1.42 1.43 -- load database access library with object relational mapper 1.44 -require 'mondelefant' 1.45 +mondelefant = require 'mondelefant' 1.46 mondelefant.connection_prototype.error_objects = true 1.47 1.48 -- load type system "atom" 1.49 -require 'atom' 1.50 +atom = require 'atom' 1.51 1.52 -- load mondelefant atom connector 1.53 require 'mondelefant_atom_connector'