From 306b577368ada153aac517e709ed3dc32b008dc1 Mon Sep 17 00:00:00 2001 From: phpnut Date: Thu, 22 Nov 2007 01:18:27 +0000 Subject: [PATCH] "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 --- cake/libs/configure.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 806dc0a3d..d7c289fa1 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -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; }