mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding fix for Cache causing App to do an directory scan when importing a core cache engine. Since these operations occurred before the core configurations had be set, a directory scan was done on every request. This change also makes in not possible to override the core cache engines with app versions.
This commit is contained in:
parent
6065f286f8
commit
850b95900b
1 changed files with 6 additions and 4 deletions
|
@ -196,11 +196,13 @@ class Cache {
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
return App::import('Lib', $plugin . '.cache' . DS . $name, false);
|
return App::import('Lib', $plugin . '.cache' . DS . $name, false);
|
||||||
} else {
|
} else {
|
||||||
$app = App::import('Lib', 'cache' . DS . $name, false);
|
$core = App::core();
|
||||||
if (!$app) {
|
$path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
|
||||||
require LIBS . 'cache' . DS . strtolower($name) . '.php';
|
if (file_exists($path)) {
|
||||||
|
require $path;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return App::import('Lib', 'cache' . DS . $name, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue