diff --git a/src/System/Cache/Storage/FileStorage.php b/src/System/Cache/Storage/FileStorage.php index 4481e836..0ece9bb8 100644 --- a/src/System/Cache/Storage/FileStorage.php +++ b/src/System/Cache/Storage/FileStorage.php @@ -103,8 +103,14 @@ public function clear(): bool ); foreach ($files as $fileinfo) { + $filePath = $fileinfo->getRealPath(); + + if (basename($filePath) === '.gitignore') { + continue; + } + $action = $fileinfo->isDir() ? 'rmdir' : 'unlink'; - $action($fileinfo->getRealPath()); + $action($filePath); } return true;