We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7af2880 + 728674a commit 6bfaa5dCopy full SHA for 6bfaa5d
src/phpFastCache/Drivers/Files/Driver.php
@@ -118,6 +118,10 @@ protected function driverDelete(CacheItemInterface $item)
118
if ($item instanceof Item) {
119
$file_path = $this->getFilePath($item->getKey(), true);
120
if (file_exists($file_path) && @unlink($file_path)) {
121
+ $dir = dirname($file_path);
122
+ if (!(new \FilesystemIterator($dir))->valid()) {
123
+ rmdir($dir);
124
+ }
125
return true;
126
} else {
127
return false;
@@ -193,4 +197,4 @@ public static function getRequiredOptions()
193
197
{
194
198
return ['path'];
195
199
}
196
-}
200
+}
0 commit comments