Commit e3a3ca0c authored by Dominik Hebeler's avatar Dominik Hebeler

fixed error in cache gc

parent b504ec20
...@@ -48,11 +48,11 @@ class CacheGC extends Command ...@@ -48,11 +48,11 @@ class CacheGC extends Command
} }
try { try {
$iterator = new \RecursiveDirectoryIterator($cachedir); foreach (new \DirectoryIterator($cachedir) as $fileInfo) {
$iterator->setFlags(\RecursiveDirectoryIterator::SKIP_DOTS); if ($fileInfo->isDot()) {
$files = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); continue;
foreach ($files as $file) { }
$file = realpath($file); $file = $fileInfo->getPathname();
$basename = basename($file); $basename = basename($file);
if (!is_dir($file) && $basename !== "cache.gc" && $basename !== ".gitignore") { if (!is_dir($file) && $basename !== "cache.gc" && $basename !== ".gitignore") {
$fp = fopen($file, 'r'); $fp = fopen($file, 'r');
...@@ -80,5 +80,6 @@ class CacheGC extends Command ...@@ -80,5 +80,6 @@ class CacheGC extends Command
} finally { } finally {
unlink($lockfile); unlink($lockfile);
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment