Permalink
Browse files

MDL-36364 Improved the deletion logic to preserve the 'prescan' setting

  • Loading branch information...
1 parent 6109f21 commit f86ce2dcb6b537fba960c4ed5cc8d1c8ec5d1e4f @scara scara committed Nov 4, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 cache/stores/file/lib.php
View
@@ -308,9 +308,13 @@ public function get_many($keys) {
public function delete($key) {
$filename = $key.'.cache';
$file = $this->path.'/'.$filename;
- $result = @unlink($file);
- unset($this->keys[$filename]);
- return $result;
+
+ if (@unlink($file)) {
+ unset($this->keys[$filename]);
+ return true;
+ }
+
+ return false;
}
/**

0 comments on commit f86ce2d

Please sign in to comment.