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 f9c0966 + b1de261 commit b6fd479Copy full SHA for b6fd479
1 file changed
src/phpFastCache/Drivers/Files/Driver.php
@@ -138,6 +138,10 @@ protected function driverDelete(CacheItemInterface $item)
138
if ($item instanceof Item) {
139
$file_path = $this->getFilePath($item->getKey(), true);
140
if (file_exists($file_path) && @unlink($file_path)) {
141
+ $dir = dirname($file_path);
142
+ if (!(new \FilesystemIterator($dir))->valid()) {
143
+ rmdir($dir);
144
+ }
145
return true;
146
} else {
147
return false;
@@ -236,4 +240,4 @@ public function getStats()
236
240
237
241
return $stat;
238
242
}
239
-}
243
+}
0 commit comments