mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
8fb9a50d3c
commit
9e9775ee53
1 changed files with 14 additions and 11 deletions
|
@ -521,17 +521,20 @@ 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) {
|
||||
$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);
|
||||
|
|
Loading…
Reference in a new issue