1
0
Fork 0

fixed: dead symlink breaks gc

pull/2888/head
Michael Kühn 2014-04-07 14:57:45 +02:00
parent d99212da52
commit 5b7e39e919
1 changed files with 2 additions and 2 deletions

View File

@ -151,14 +151,14 @@ class Cache
$finder = $this->getFinder()->date('until '.$expire->format('Y-m-d H:i:s')); $finder = $this->getFinder()->date('until '.$expire->format('Y-m-d H:i:s'));
foreach ($finder as $file) { foreach ($finder as $file) {
unlink($file->getRealPath()); unlink($file->getPathname());
} }
$totalSize = $this->filesystem->size($this->root); $totalSize = $this->filesystem->size($this->root);
if ($totalSize > $maxSize) { if ($totalSize > $maxSize) {
$iterator = $this->getFinder()->sortByAccessedTime()->getIterator(); $iterator = $this->getFinder()->sortByAccessedTime()->getIterator();
while ($totalSize > $maxSize && $iterator->valid()) { while ($totalSize > $maxSize && $iterator->valid()) {
$filepath = $iterator->current()->getRealPath(); $filepath = $iterator->current()->getPathname();
$totalSize -= $this->filesystem->size($filepath); $totalSize -= $this->filesystem->size($filepath);
unlink($filepath); unlink($filepath);
$iterator->next(); $iterator->next();