From 32e16dd2c7c578a6f5cb67523e1168959abcf9fe Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 6 Jul 2013 08:06:03 +0000 Subject: [PATCH] Set the include path to use with config.php inside the database.php class. --- resources/classes/database.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/classes/database.php b/resources/classes/database.php index 0a8617299e..3a21403b84 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -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; }