From f295a21831da73d9e4722654fc20ca32a500b661 Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 22 Jul 2009 09:11:38 -0700 Subject: [PATCH] updating some code related to Configure/App changes. Fixing issue when cache is not configured --- app/webroot/test.php | 2 +- cake/console/cake.php | 4 ++-- cake/console/libs/templates/skel/webroot/test.php | 2 +- cake/console/libs/testsuite.php | 2 +- cake/libs/cache.php | 2 +- cake/libs/configure.php | 6 +++--- cake/libs/debugger.php | 2 +- cake/tests/lib/cake_test_case.php | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/webroot/test.php b/app/webroot/test.php index 1e9a044ac1d..b4ac3834067 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -86,7 +86,7 @@ trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR); } -$corePath = Configure::corePaths('cake'); +$corePath = App::core('cake'); if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); } else { diff --git a/cake/console/cake.php b/cake/console/cake.php index 1c234e23aab..f6f8ccf94cf 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -259,8 +259,8 @@ function __bootstrap() { Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { - include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; - Configure::buildPaths(array()); + include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; + App::build(); } Configure::write('debug', 1); diff --git a/cake/console/libs/templates/skel/webroot/test.php b/cake/console/libs/templates/skel/webroot/test.php index 1e9a044ac1d..b4ac3834067 100644 --- a/cake/console/libs/templates/skel/webroot/test.php +++ b/cake/console/libs/templates/skel/webroot/test.php @@ -86,7 +86,7 @@ trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR); } -$corePath = Configure::corePaths('cake'); +$corePath = App::core('cake'); if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); } else { diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index caf76060984..56bc18d6f1c 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -81,7 +81,7 @@ class TestSuiteShell extends Shell { * @access public */ function initialize() { - $corePath = Configure::corePaths('cake'); + $corePath = App::core('cake'); if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); } else { diff --git a/cake/libs/cache.php b/cake/libs/cache.php index aabd279512b..5f671c95804 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -192,7 +192,7 @@ function set($settings = array(), $value = null) { } $settings = array_merge($_this->__config[$_this->__name], $settings); } - $_this->_Engine[$engine]->init($settings); + $_this->engine($engine, $settings); } return $_this->settings($engine); diff --git a/cake/libs/configure.php b/cake/libs/configure.php index f73499d22e8..c38462b51eb 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -412,16 +412,16 @@ function __loadBootstrap($boot) { } else { $duration = '+999 days'; } - + if (Cache::config('_cake_core_') === false) { - Cache::config('_cake_core_', array_merge($cache['settings'], array( + Cache::config('_cake_core_', array_merge((array)$cache['settings'], array( 'prefix' => $prefix . 'cake_core_', 'path' => $path . DS . 'persistent' . DS, 'serialize' => true, 'duration' => $duration ))); } if (Cache::config('_cake_model_') === false) { - Cache::config('_cake_model_', array_merge($cache['settings'], array( + Cache::config('_cake_model_', array_merge((array)$cache['settings'], array( 'prefix' => $prefix . 'cake_model_', 'path' => $path . DS . 'models' . DS, 'serialize' => true, 'duration' => $duration ))); diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index bab67ae80a8..dc6e1357d8d 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -425,7 +425,7 @@ function trimPath($path) { } elseif (strpos($path, ROOT) === 0) { return str_replace(ROOT, 'ROOT', $path); } - $corePaths = Configure::corePaths('cake'); + $corePaths = App::core('cake'); foreach ($corePaths as $corePath) { if (strpos($path, $corePath) === 0) { return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 795be9311f5..bd8425f2e86 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -726,7 +726,7 @@ function _loadFixtures() { if (strpos($fixture, 'core.') === 0) { $fixture = substr($fixture, strlen('core.')); - foreach (Configure::corePaths('cake') as $key => $path) { + foreach (App::core('cake') as $key => $path) { $fixturePaths[] = $path . 'tests' . DS . 'fixtures'; } } elseif (strpos($fixture, 'app.') === 0) {