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