From 7df8705ebe7bc67df6104248a34d75020ec97c8a Mon Sep 17 00:00:00 2001 From: Brad Shuttleworth Date: Thu, 13 Apr 2006 14:01:44 +0000 Subject: [PATCH] fix for memory issue. --- thirdparty/pear/Cache/Lite.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/thirdparty/pear/Cache/Lite.php b/thirdparty/pear/Cache/Lite.php index 530d568..29c6667 100644 --- a/thirdparty/pear/Cache/Lite.php +++ b/thirdparty/pear/Cache/Lite.php @@ -574,7 +574,8 @@ class Cache_Lite */ function _unlink($file) { - if (!@unlink($file)) { + if (!unlink($file)) { + return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); } return true; @@ -599,11 +600,12 @@ class Cache_Lite } if ($this->_memoryCaching) { while (list($key, ) = each($this->_memoryCachingArray)) { - if (strpos($key, $motif, 0)) { + if (strstr($key, $motif) !== false) { unset($this->_memoryCachingArray[$key]); $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; } } + reset($this->_memoryCachingArray); if ($this->_onlyMemoryCaching) { return true; } @@ -640,7 +642,8 @@ class Cache_Lite case 'ingroup': default: if (strpos($file2, $motif, 0)) { - $result = ($result and ($this->_unlink($file2))); + //$result = ($result and ($this->_unlink($file2))); + $this->_unlink($file2); } break; } @@ -680,7 +683,6 @@ class Cache_Lite */ function _setFileName($id, $group) { - if ($this->_fileNameProtection) { $suffix = 'cache_'.md5($group).'_'.md5($id); } else { -- libgit2 0.21.4