mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
updating some code related to Configure/App changes. Fixing issue when cache is not configured
This commit is contained in:
parent
8dc777a2b7
commit
f295a21831
8 changed files with 11 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
$corePath = Configure::corePaths('cake');
|
||||
$corePath = App::core('cake');
|
||||
if (isset($corePath[0])) {
|
||||
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
|
||||
} else {
|
||||
|
|
|
@ -259,8 +259,8 @@ class ShellDispatcher {
|
|||
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
$corePath = Configure::corePaths('cake');
|
||||
$corePath = App::core('cake');
|
||||
if (isset($corePath[0])) {
|
||||
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
|
||||
} else {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -192,7 +192,7 @@ class Cache extends Object {
|
|||
}
|
||||
$settings = array_merge($_this->__config[$_this->__name], $settings);
|
||||
}
|
||||
$_this->_Engine[$engine]->init($settings);
|
||||
$_this->engine($engine, $settings);
|
||||
}
|
||||
|
||||
return $_this->settings($engine);
|
||||
|
|
|
@ -414,14 +414,14 @@ class Configure extends Object {
|
|||
}
|
||||
|
||||
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
|
||||
)));
|
||||
|
|
|
@ -425,7 +425,7 @@ class Debugger extends Object {
|
|||
} 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);
|
||||
|
|
|
@ -726,7 +726,7 @@ class CakeTestCase extends UnitTestCase {
|
|||
|
||||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue