From 8dc7515045a669e0c49ef50c1a8d70874c7253a0 Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 22 May 2008 14:18:21 +0000 Subject: [PATCH] fixes #4729, configure notice on cache path git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7007 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/configure.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 620b9fd9f..ed261b732 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -636,23 +636,21 @@ class Configure extends Object { if ($_this->read('Cache.disable') !== true) { $cache = Cache::config('default'); - + if (empty($cache['settings'])) { trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING); - list($engine, $cache) = Cache::config('default', array('engine' => 'File')); - } else { - $cache = $cache['settings']; + $cache = Cache::config('default', array('engine' => 'File')); } - + + $settings = array_merge($cache['settings'], array('prefix' => 'cake_core_', 'serialize' => true)); + if (Configure::read() > 1) { - $cache['duration'] = 10; + $settings['duration'] = 10; } - $settings = array( - 'prefix' => 'cake_core_', - 'path' => realpath($cache['path'].DS.'persistent').DS, - 'serialize' => true - ); - $config = Cache::config('_cake_core_' , array_merge($cache, $settings)); + if (!empty($cache['path'])) { + $settings['path'] = realpath($cache['path'] . DS . 'persistent') . DS; + } + Cache::config('_cake_core_' , $settings); } } if (empty($_this->modelPaths)) {