mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
"Correcting paths search in Configure::load()"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6038 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0a664d7fbc
commit
306b577368
1 changed files with 13 additions and 2 deletions
|
@ -325,14 +325,25 @@ class Configure extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function load($fileName) {
|
||||
$found = false;
|
||||
$_this =& Configure::getInstance();
|
||||
if (file_exists(CONFIGS . $fileName . '.php')) {
|
||||
include(CONFIGS . $fileName . '.php');
|
||||
$found = true;
|
||||
} elseif (file_exists(CACHE . 'persistent' . DS . $fileName . '.php')) {
|
||||
include(CACHE . 'persistent' . DS . $fileName . '.php');
|
||||
} elseif (file_exists(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'config' . DS . $fileName . '.php')) {
|
||||
include(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'config' . DS . $fileName . '.php');
|
||||
$found = true;
|
||||
} else {
|
||||
foreach ($_this->corePaths('cake') as $key => $path) {
|
||||
if (file_exists($path . DS . 'config' . DS . $fileName . '.php')) {
|
||||
include($path . DS . 'config' . DS . $fileName . '.php');
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$found) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue