"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:
phpnut 2007-11-22 01:18:27 +00:00
parent 0a664d7fbc
commit 306b577368

View file

@ -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;
}