Browse Source

Merge remote-tracking branch 'johnstevenson/unlink-fix-2'

Jordi Boggiano 12 years ago
parent
commit
16a9839688
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Composer/Factory.php

+ 3 - 1
src/Composer/Factory.php

@@ -17,6 +17,7 @@ use Composer\Json\JsonFile;
 use Composer\IO\IOInterface;
 use Composer\Repository\ComposerRepository;
 use Composer\Repository\RepositoryManager;
+use Composer\Util\Filesystem;
 use Composer\Util\ProcessExecutor;
 use Composer\Util\RemoteFilesystem;
 use Symfony\Component\Console\Formatter\OutputFormatterStyle;
@@ -86,6 +87,7 @@ class Factory
             'cache-vcs-dir' => array('/cache.git' => '/*', '/cache.hg' => '/*'),
             'cache-files-dir' => array('/cache.files' => '/*'),
         );
+        $filesystem = new Filesystem();
         foreach ($legacyPaths as $key => $oldPaths) {
             foreach ($oldPaths as $oldPath => $match) {
                 $dir = $config->get($key);
@@ -105,7 +107,7 @@ class Factory
                             @rename($child, $dir.'/'.basename($child));
                         }
                     }
-                    @unlink($oldPath);
+                    $filesystem->removeDirectory($oldPath);
                 }
             }
         }