From e3a85de9dba9a623316064e54cb76d5886a0cd4c Mon Sep 17 00:00:00 2001 From: Athlan Date: Sun, 19 Mar 2017 22:31:26 +0100 Subject: [PATCH] Fixes #347. FileSystem Driver - do not delete root cache directory while clear on entire pool. --- src/Stash/Driver/FileSystem.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Stash/Driver/FileSystem.php b/src/Stash/Driver/FileSystem.php index 442b7907..33670e1c 100644 --- a/src/Stash/Driver/FileSystem.php +++ b/src/Stash/Driver/FileSystem.php @@ -321,6 +321,11 @@ protected function makePath($key = null) public function clear($key = null) { $path = $this->makePath($key); + + if($key === null) { + return Utilities::deleteRecursive($path, false); + } + if (is_file($path)) { $return = true; unlink($path);