浏览代码

fixed: dead symlink breaks gc

Michael Kühn 11 年之前
父节点
当前提交
5b7e39e919
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Cache.php

+ 2 - 2
src/Composer/Cache.php

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