Ensure PROJECT_ROOT is defined

This commit is contained in:
FusionPBX 2023-05-08 18:50:32 -06:00 committed by GitHub
parent edb12399ce
commit 0413b998e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -31,14 +31,16 @@
//set the server variables and define project path constant //set the server variables and define project path constant
$_SERVER["DOCUMENT_ROOT"] = $conf['document.root']; $_SERVER["DOCUMENT_ROOT"] = $conf['document.root'];
$_SERVER["PROJECT_PATH"] = $conf['project.path']; $_SERVER["PROJECT_ROOT"] = $conf['document.root'];
if (isset($conf['project.path'])) { if (isset($conf['project.path'])) {
$_SERVER["PROJECT_ROOT"] = $conf['document.root'].$conf['project.path']; $_SERVER["PROJECT_ROOT"] = $conf['document.root'].'/'.$conf['project.path'];
define("PROJECT_ROOT", $conf['document.root'].'/'.$conf['project.path']);
define("PROJECT_PATH", $conf['project.path']);
} }
else { else {
$_SERVER["PROJECT_ROOT"] = $conf['document.root']; define("PROJECT_ROOT", $conf['document.root']);
define("PROJECT_PATH", $conf['document.root']);
} }
define("PROJECT_PATH", $conf['project.path']);
//set the error reporting //set the error reporting
ini_set('display_errors', '1'); ini_set('display_errors', '1');