Revert "Revert "Change. Use require "resources.functions.config" to load co…"

This commit is contained in:
Alexey Melnichuk
2015-08-11 05:06:33 +03:00
parent 1615de1358
commit 3e16e69adb
69 changed files with 294 additions and 507 deletions

View File

@@ -26,16 +26,8 @@
--set the debug options
debug["sql"] = false;
--define explode
function explode ( seperator, str )
local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- attach chars left of current divider
pos = sp + 1 -- jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- attach chars right of last divider
return arr
end
--define the explode function
require "resources.functions.explode";
--set the defaults
max_tries = 3;
@@ -44,13 +36,8 @@
tries = 0;
profile = "internal";
--include config.lua
--scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1));
--dofile(scripts_dir.."/resources/functions/config.lua");
--dofile(config());
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--answer