Commit 7df8705ebe7bc67df6104248a34d75020ec97c8a
1 parent
0a6e4168
fix for memory issue.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5240 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
4 deletions
thirdparty/pear/Cache/Lite.php
| @@ -574,7 +574,8 @@ class Cache_Lite | @@ -574,7 +574,8 @@ class Cache_Lite | ||
| 574 | */ | 574 | */ |
| 575 | function _unlink($file) | 575 | function _unlink($file) |
| 576 | { | 576 | { |
| 577 | - if (!@unlink($file)) { | 577 | + if (!unlink($file)) { |
| 578 | + | ||
| 578 | return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); | 579 | return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); |
| 579 | } | 580 | } |
| 580 | return true; | 581 | return true; |
| @@ -599,11 +600,12 @@ class Cache_Lite | @@ -599,11 +600,12 @@ class Cache_Lite | ||
| 599 | } | 600 | } |
| 600 | if ($this->_memoryCaching) { | 601 | if ($this->_memoryCaching) { |
| 601 | while (list($key, ) = each($this->_memoryCachingArray)) { | 602 | while (list($key, ) = each($this->_memoryCachingArray)) { |
| 602 | - if (strpos($key, $motif, 0)) { | 603 | + if (strstr($key, $motif) !== false) { |
| 603 | unset($this->_memoryCachingArray[$key]); | 604 | unset($this->_memoryCachingArray[$key]); |
| 604 | $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; | 605 | $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; |
| 605 | } | 606 | } |
| 606 | } | 607 | } |
| 608 | + reset($this->_memoryCachingArray); | ||
| 607 | if ($this->_onlyMemoryCaching) { | 609 | if ($this->_onlyMemoryCaching) { |
| 608 | return true; | 610 | return true; |
| 609 | } | 611 | } |
| @@ -640,7 +642,8 @@ class Cache_Lite | @@ -640,7 +642,8 @@ class Cache_Lite | ||
| 640 | case 'ingroup': | 642 | case 'ingroup': |
| 641 | default: | 643 | default: |
| 642 | if (strpos($file2, $motif, 0)) { | 644 | if (strpos($file2, $motif, 0)) { |
| 643 | - $result = ($result and ($this->_unlink($file2))); | 645 | + //$result = ($result and ($this->_unlink($file2))); |
| 646 | + $this->_unlink($file2); | ||
| 644 | } | 647 | } |
| 645 | break; | 648 | break; |
| 646 | } | 649 | } |
| @@ -680,7 +683,6 @@ class Cache_Lite | @@ -680,7 +683,6 @@ class Cache_Lite | ||
| 680 | */ | 683 | */ |
| 681 | function _setFileName($id, $group) | 684 | function _setFileName($id, $group) |
| 682 | { | 685 | { |
| 683 | - | ||
| 684 | if ($this->_fileNameProtection) { | 686 | if ($this->_fileNameProtection) { |
| 685 | $suffix = 'cache_'.md5($group).'_'.md5($id); | 687 | $suffix = 'cache_'.md5($group).'_'.md5($id); |
| 686 | } else { | 688 | } else { |