mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 18:53:49 +00:00
Merge pull request #1053 from moteus/require_config
Change. Use `require "resources.functions.config"` to load config file.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user