mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Cache::configured() and in_array() are faster than calling Cache::config() 6 times.
This commit is contained in:
parent
0a266fa1fc
commit
79bbd227e3
1 changed files with 3 additions and 2 deletions
|
@ -93,15 +93,16 @@ class Configure {
|
|||
} 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
|
||||
|
|
Loading…
Reference in a new issue