Set the include path to use with config.php inside the database.php class.

This commit is contained in:
Mark Crane 2013-07-06 08:06:03 +00:00
parent 8e3be308e8
commit 32e16dd2c7
1 changed files with 11 additions and 1 deletions

View File

@ -53,7 +53,17 @@ include "root.php";
if (strlen($this->type) == 0 && strlen($this->name) == 0) {
//include config.php
include "root.php";
include "includes/config.php";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
include $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php";
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php")) {
include $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php";
} elseif (file_exists("/etc/fusionpbx/config.php")){
//linux
include "/etc/fusionpbx/config.php";
} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")){
//bsd
include "/usr/local/etc/fusionpbx/config.php";
}
//backwards compatibility
if (isset($dbtype)) { $db_type = $dbtype; }