From 9e9775ee53152a4a7a29456231938b30d32e3dc9 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 1 Aug 2008 23:46:53 +0000 Subject: [PATCH] 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 --- cake/basics.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 978246e77..bae0259d5 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -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; } -?> \ No newline at end of file +?>