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 | 574 | */ |
| 575 | 575 | function _unlink($file) |
| 576 | 576 | { |
| 577 | - if (!@unlink($file)) { | |
| 577 | + if (!unlink($file)) { | |
| 578 | + | |
| 578 | 579 | return $this->raiseError('Cache_Lite : Unable to remove cache !', -3); |
| 579 | 580 | } |
| 580 | 581 | return true; |
| ... | ... | @@ -599,11 +600,12 @@ class Cache_Lite |
| 599 | 600 | } |
| 600 | 601 | if ($this->_memoryCaching) { |
| 601 | 602 | while (list($key, ) = each($this->_memoryCachingArray)) { |
| 602 | - if (strpos($key, $motif, 0)) { | |
| 603 | + if (strstr($key, $motif) !== false) { | |
| 603 | 604 | unset($this->_memoryCachingArray[$key]); |
| 604 | 605 | $this->_memoryCachingCounter = $this->_memoryCachingCounter - 1; |
| 605 | 606 | } |
| 606 | 607 | } |
| 608 | + reset($this->_memoryCachingArray); | |
| 607 | 609 | if ($this->_onlyMemoryCaching) { |
| 608 | 610 | return true; |
| 609 | 611 | } |
| ... | ... | @@ -640,7 +642,8 @@ class Cache_Lite |
| 640 | 642 | case 'ingroup': |
| 641 | 643 | default: |
| 642 | 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 | 648 | break; |
| 646 | 649 | } |
| ... | ... | @@ -680,7 +683,6 @@ class Cache_Lite |
| 680 | 683 | */ |
| 681 | 684 | function _setFileName($id, $group) |
| 682 | 685 | { |
| 683 | - | |
| 684 | 686 | if ($this->_fileNameProtection) { |
| 685 | 687 | $suffix = 'cache_'.md5($group).'_'.md5($id); |
| 686 | 688 | } else { | ... | ... |