Skip to content

Commit

Permalink
Adding fix for Cache causing App to do an directory scan when importi…
Browse files Browse the repository at this point in the history
…ng 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.
  • Loading branch information
markstory committed Dec 20, 2009
1 parent 6065f28 commit 850b959
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cake/libs/cache.php
Expand Up @@ -196,11 +196,13 @@ function __loadEngine($name, $plugin = null) {
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);
}
}

Expand Down

0 comments on commit 850b959

Please sign in to comment.