Skip to content

Commit

Permalink
Cache::configured() and in_array() are faster than calling Cache::con…
Browse files Browse the repository at this point in the history
…fig() 6 times.
  • Loading branch information
markstory committed Feb 5, 2011
1 parent 0a266fa commit 79bbd22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cake/libs/configure.php
Expand Up @@ -93,15 +93,16 @@ public static function bootstrap($boot = true) {
} else {
$duration = '+999 days';
}
$cacheConfigs = Cache::configured();

if (Cache::config('_cake_core_') === false) {
if (!in_array('_cake_core_', $cacheConfigs)) {
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) {
if (!in_array('_cake_model_', $cacheConfigs)) {
Cache::config('_cake_model_', array_merge((array)$cache['settings'], array(
'prefix' => $prefix . 'cake_model_', 'path' => $path . DS . 'models' . DS,
'serialize' => true, 'duration' => $duration
Expand Down

0 comments on commit 79bbd22

Please sign in to comment.