From 79bbd227e377d68a8410ce4139329e14398fccd2 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 5 Feb 2011 10:30:28 -0500 Subject: [PATCH] Cache::configured() and in_array() are faster than calling Cache::config() 6 times. --- cake/libs/configure.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 1546ae08795..5c4cc74b882 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -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