BUGFIX: Fixed crash when BASE_PATH is set by assuming the location of Constants.php

This commit is contained in:
UndefinedOffset 2016-11-04 13:43:42 -03:00
parent 857caa8fff
commit f18ef75c3d

View File

@ -188,10 +188,10 @@ if(!defined('BASE_PATH')) {
} }
} }
// Determine BASE_PATH by assuming that this file is framework/core/Core.php // Determine BASE_PATH by assuming that this file is framework/src/Core/Constants.php
if(!defined('BASE_PATH')) { if(!defined('BASE_PATH')) {
// we can then determine the base path // we can then determine the base path
$candidateBasePath = rtrim(dirname(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR); $candidateBasePath = rtrim(dirname(dirname(dirname(dirname(__FILE__)))), DIRECTORY_SEPARATOR);
// We can't have an empty BASE_PATH. Making it / means that double-slashes occur in places but that's benign. // We can't have an empty BASE_PATH. Making it / means that double-slashes occur in places but that's benign.
// This likely only happens on chrooted environemnts // This likely only happens on chrooted environemnts
if($candidateBasePath == '') $candidateBasePath = DIRECTORY_SEPARATOR; if($candidateBasePath == '') $candidateBasePath = DIRECTORY_SEPARATOR;