diff --git a/VERSION.txt b/VERSION.txt index a4e357362..c72bb9bf6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -1.0.0.2268 \ No newline at end of file +1.0.0.2271 \ No newline at end of file diff --git a/cake/basics.php b/cake/basics.php index e53305d05..ab4f3021b 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -916,7 +916,8 @@ function clearCache($params = null, $type = 'views', $ext = '.php') $cache = CACHE.$type.DS.$params; if(is_file($cache.$ext)) { - return unlink($cache); + @unlink($cache.$ext); + return true; } else if(is_dir($cache)) { @@ -925,7 +926,14 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { return false; } - array_map('unlink', $files); + + foreach($files as $file) + { + if(is_file($file)) + { + @unlink($file); + } + } return true; } else @@ -936,7 +944,13 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { return false; } - array_map('unlink', $files); + foreach($files as $file) + { + if(is_file($file)) + { + @unlink($file); + } + } return true; } } @@ -953,7 +967,13 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { if(is_array($delete)) { - array_map('unlink', $delete); + foreach($delete as $file) + { + if(is_file($file)) + { + @unlink($file); + } + } } } return true; diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 22fc05aba..32479337a 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -114,37 +114,28 @@ if(defined('CACHE_CHECK') && CACHE_CHECK === true) $uri = setUri(); } - $pattern = str_replace('/', '_', $uri); - $filename = CACHE.'views'.DS.'*'.$pattern .'*'; - $files = glob($filename); + $filename = CACHE.'views'.DS.str_replace('/', '_', $uri.'.php'); - foreach ($files as $file) + if (file_exists($filename)) { - if (preg_match('/('.$pattern.')(_{0,2}\\d+)/', $file)) + ob_start(); + include($filename); + if (DEBUG) { - if (file_exists($file)) + echo ""; + } + $out = ob_get_clean(); + if (preg_match('/^/', $out, $match)) + { + if(time() >= $match['1']) { - if (preg_match('/(\\d+).php/', $file, $match)) - { - if(time() >= $match['1']) - { - @unlink($file); - unset($out); - } - else - { - ob_start(); - include($file); - if (DEBUG) - { - echo ""; - } - $out = ob_get_clean(); - die(e($out)); - } - } + @unlink($filename); + unset($out); + } + else + { + die(e($out)); } - break; } } } diff --git a/cake/libs/model/model_php5.php b/cake/libs/model/model_php5.php index f8ceac69c..4a74926d8 100644 --- a/cake/libs/model/model_php5.php +++ b/cake/libs/model/model_php5.php @@ -1700,10 +1700,6 @@ class Model extends Object } } } - echo "
";
-                print_r($assoc);
-                echo "
"; - die(); clearCache($assoc); return true; } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 83a74080f..5554df1c7 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -809,8 +809,9 @@ class View extends Object $cacheTime = $now + strtotime($timestamp); } $result = preg_replace('/\/\//', '/', $this->here); - $cache = str_replace('/', '_', $result.'_'.$cacheTime.'.php'); + $cache = str_replace('/', '_', $result.'.php'); $cache = str_replace('favicon.ico', '', $cache); + $view = ''.$view; return cache('views'.DS.$cache, $view, $timestamp); } }