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:
Mark Story 2009-12-20 18:11:18 -05:00
parent 6065f286f8
commit 850b95900b

View file

@ -196,11 +196,13 @@ class Cache {
if ($plugin) {
return App::import('Lib', $plugin . '.cache' . DS . $name, false);
} else {
$app = App::import('Lib', 'cache' . DS . $name, false);
if (!$app) {
require LIBS . 'cache' . DS . strtolower($name) . '.php';
$core = App::core();
$path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
if (file_exists($path)) {
require $path;
return true;
}
return true;
return App::import('Lib', 'cache' . DS . $name, false);
}
}