From 0a47fc22b34eda440f8f71fb736179579a5e763e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 11 Oct 2022 17:10:39 -0600 Subject: [PATCH] Get the DOCUMENT_ROOT and PROJECT_PATH --- resources/classes/schema.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/classes/schema.php b/resources/classes/schema.php index 04addb2a33..33405ed7ae 100644 --- a/resources/classes/schema.php +++ b/resources/classes/schema.php @@ -45,6 +45,13 @@ if (!class_exists('schema')) { $this->db = $database->db; } + //set the include path + $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); + set_include_path(parse_ini_file($conf[0])['document.root']); + + //includes files + include "resources/require.php"; + //get the list of installed apps from the core and mod directories $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php"); $x=0; @@ -491,7 +498,7 @@ if (!class_exists('schema')) { set_include_path(parse_ini_file($conf[0])['document.root']); //includes files - require_once "resources/require.php"; + include "resources/require.php"; //add multi-lingual support if (!isset($text)) { @@ -560,6 +567,7 @@ if (!class_exists('schema')) { } } if (strlen($table_name) > 0) { + //check if the table exists if ($this->db_table_exists($db_type, $db_name, $table_name)) { $apps[$x]['db'][$y]['exists'] = 'true';