Edit: root.php updated

This commit is contained in:
reliberate 2016-02-24 12:49:20 -07:00
parent e736538654
commit da3112e0a5
1 changed files with 6 additions and 6 deletions

View File

@ -39,14 +39,14 @@
chdir(pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME));
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
if (file_exists('/.project.ROOT')) {
if (file_exists('/project_root.php')) {
$path = '/';
} else {
$i = 1;
$path = '';
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/.project.ROOT')) {
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
@ -61,7 +61,7 @@
if (!defined('PROJECT_PATH')) {
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
define('PROJECT_PATH', '/fusionpbx');
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/.project.ROOT')) {
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
define('PROJECT_PATH', '');
} else {
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
@ -69,13 +69,13 @@
$path = $_SERVER["DOCUMENT_ROOT"];
while ($i < count($dirs)) {
$path .= '/' . $dirs[$i];
if (file_exists($path. '/.project.ROOT')) {
if (file_exists($path. '/project_root.php')) {
break;
}
$i++;
}
if(!file_exists($path. '/.project.ROOT')){
die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance");
if(!file_exists($path. '/project_root.php')){
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
}
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
define('PROJECT_PATH', $project_path);