Merge pull request #1053 from moteus/require_config

Change. Use `require "resources.functions.config"` to load config file.
This commit is contained in:
FusionPBX
2015-08-10 11:31:35 -06:00
69 changed files with 294 additions and 507 deletions

View File

@@ -39,9 +39,9 @@
debug["cache"] = false;
--general functions
dofile(scripts_dir.."/resources/functions/trim.lua");
dofile(scripts_dir.."/resources/functions/file_exists.lua");
dofile(scripts_dir.."/resources/functions/explode.lua");
require "resources.functions.trim";
require "resources.functions.file_exists";
require "resources.functions.explode";
--if the params class and methods do not exist then add them to prevent errors
if (not params) then

View File

@@ -36,7 +36,7 @@
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -36,7 +36,7 @@
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -35,7 +35,7 @@
if (XML_STRING == "-ERR NOT FOUND") then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -25,7 +25,7 @@
-- POSSIBILITY OF SUCH DAMAGE.
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -34,7 +34,7 @@
--set the cache
if (XML_STRING == "-ERR NOT FOUND") then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -32,7 +32,7 @@
--user_call - user has been called
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly

View File

@@ -109,7 +109,7 @@
--database connection
if (continue) then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly
@@ -154,14 +154,14 @@
--freeswitch.consoleLog("notice", "[xml_handler-directory.lua] local_hostname is " .. local_hostname .. "\n");
--add the file_exists function
dofile(scripts_dir.."/resources/functions/file_exists.lua");
require "resources.functions.file_exists";
--connect to the switch database
if (file_exists(database_dir.."/core.db")) then
--dbh_switch = freeswitch.Dbh("core:core"); -- when using sqlite
dbh_switch = freeswitch.Dbh("sqlite://"..database_dir.."/core.db");
else
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh_switch = database_handle('switch');
end

View File

@@ -65,7 +65,7 @@
--database connection
if (continue) then
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
require "resources.functions.database_handle";
dbh = database_handle('system');
--exits the script if we didn't connect properly