From f86ce2dcb6b537fba960c4ed5cc8d1c8ec5d1e4f Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Sun, 4 Nov 2012 23:44:33 +0100 Subject: [PATCH] MDL-36364 Improved the deletion logic to preserve the 'prescan' setting --- cache/stores/file/lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 3428d92d63e..90ed0e49687 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -308,9 +308,13 @@ class cachestore_file implements cache_store, cache_is_key_aware { 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; } /**