Use __dir__ to find resources/require.php
This commit is contained in:
@@ -63,13 +63,10 @@ class config {
|
||||
* @var string $config_path - full path to the config.php file
|
||||
*/
|
||||
public function find() {
|
||||
//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
|
||||
require_once "resources/require.php";
|
||||
// find the file
|
||||
require dirname(__DIR__, 2) . "/resources/require.php";
|
||||
|
||||
//find the file
|
||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
|
||||
$this->config_path = $_SERVER["PROJECT_ROOT"]."/resources/config.php";
|
||||
} elseif (file_exists("/etc/fusionpbx/config.php")) {
|
||||
@@ -80,6 +77,7 @@ class config {
|
||||
else {
|
||||
$this->config_path = '';
|
||||
}
|
||||
|
||||
//return the path
|
||||
return $this->config_path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user