Fixing clearCache() no notices are generated. Closes #5012

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7416 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2008-08-01 23:46:53 +00:00
parent 8fb9a50d3c
commit 9e9775ee53

View file

@ -520,18 +520,21 @@ if (!function_exists('clone')) {
} }
} }
return true; return true;
} else { } else {
$cache = CACHE . $type . DS . '*' . $params . $ext; $cache = array(
$files = glob($cache); CACHE . $type . DS . '*' . $params . $ext,
CACHE . $type . DS . '*' . $params . '_*' . $ext
$cache = CACHE . $type . DS . '*' . $params . '_*' . $ext; );
$files = array();
if ($files === false) { while ($search = array_shift($cache)) {
$results = glob($search);
if ($results !== false) {
$files = array_merge($files, $results);
}
}
if (empty($files)) {
return false; return false;
} }
$files = array_merge($files, glob($cache));
foreach ($files as $file) { foreach ($files as $file) {
if (is_file($file)) { if (is_file($file)) {
@unlink($file); @unlink($file);
@ -916,4 +919,4 @@ if (!function_exists('clone')) {
} }
return $val2; return $val2;
} }
?> ?>