From 2dec8f4a4f24bf3c25790fb5fc56ad2261f6699f Mon Sep 17 00:00:00 2001 From: Amr Fayad Date: Mon, 26 Mar 2018 15:07:17 +0200 Subject: [PATCH] Clear Cache Files clear all cache file --- cache.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cache.class.php b/cache.class.php index 33c7c23..fae7b6f 100644 --- a/cache.class.php +++ b/cache.class.php @@ -309,5 +309,19 @@ public function setExtension($ext) { public function getExtension() { return $this->_extension; } + + /** + * Clear All Cached Files + * + */ + public function clearCachedFiles(){ + $cacheDir = $this->getCachePath(); + $files = glob($cacheDir.'*'); // get all file names + foreach($files as $file){ // iterate files + if (is_file($file)) { + unlink($file);// delete file + } + } + } }