updating some code related to Configure/App changes. Fixing issue when cache is not configured

This commit is contained in:
gwoo 2009-07-22 09:11:38 -07:00
parent 8dc777a2b7
commit f295a21831
8 changed files with 11 additions and 11 deletions

View file

@ -86,7 +86,7 @@ if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
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); 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])) { if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
} else { } else {

View file

@ -259,8 +259,8 @@ class ShellDispatcher {
Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php'));
if (!file_exists(APP_PATH . 'config' . DS . 'core.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'; include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
Configure::buildPaths(array()); App::build();
} }
Configure::write('debug', 1); Configure::write('debug', 1);

View file

@ -86,7 +86,7 @@ if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
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); 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])) { if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
} else { } else {

View file

@ -81,7 +81,7 @@ class TestSuiteShell extends Shell {
* @access public * @access public
*/ */
function initialize() { function initialize() {
$corePath = Configure::corePaths('cake'); $corePath = App::core('cake');
if (isset($corePath[0])) { if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
} else { } else {

View file

@ -192,7 +192,7 @@ class Cache extends Object {
} }
$settings = array_merge($_this->__config[$_this->__name], $settings); $settings = array_merge($_this->__config[$_this->__name], $settings);
} }
$_this->_Engine[$engine]->init($settings); $_this->engine($engine, $settings);
} }
return $_this->settings($engine); return $_this->settings($engine);

View file

@ -412,16 +412,16 @@ class Configure extends Object {
} else { } else {
$duration = '+999 days'; $duration = '+999 days';
} }
if (Cache::config('_cake_core_') === false) { 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, 'prefix' => $prefix . 'cake_core_', 'path' => $path . DS . 'persistent' . DS,
'serialize' => true, 'duration' => $duration 'serialize' => true, 'duration' => $duration
))); )));
} }
if (Cache::config('_cake_model_') === false) { 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, 'prefix' => $prefix . 'cake_model_', 'path' => $path . DS . 'models' . DS,
'serialize' => true, 'duration' => $duration 'serialize' => true, 'duration' => $duration
))); )));

View file

@ -425,7 +425,7 @@ class Debugger extends Object {
} elseif (strpos($path, ROOT) === 0) { } elseif (strpos($path, ROOT) === 0) {
return str_replace(ROOT, 'ROOT', $path); return str_replace(ROOT, 'ROOT', $path);
} }
$corePaths = Configure::corePaths('cake'); $corePaths = App::core('cake');
foreach ($corePaths as $corePath) { foreach ($corePaths as $corePath) {
if (strpos($path, $corePath) === 0) { if (strpos($path, $corePath) === 0) {
return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path); return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path);

View file

@ -726,7 +726,7 @@ class CakeTestCase extends UnitTestCase {
if (strpos($fixture, 'core.') === 0) { if (strpos($fixture, 'core.') === 0) {
$fixture = substr($fixture, strlen('core.')); $fixture = substr($fixture, strlen('core.'));
foreach (Configure::corePaths('cake') as $key => $path) { foreach (App::core('cake') as $key => $path) {
$fixturePaths[] = $path . 'tests' . DS . 'fixtures'; $fixturePaths[] = $path . 'tests' . DS . 'fixtures';
} }
} elseif (strpos($fixture, 'app.') === 0) { } elseif (strpos($fixture, 'app.') === 0) {