From ff1cf15cb4c979f48d6925182dc60c293e8665ff Mon Sep 17 00:00:00 2001 From: johnstevenson Date: Mon, 28 Jan 2013 15:38:50 +0000 Subject: [PATCH] Fix unlink(folder) failure on Windows using removeDirectory() --- src/Composer/Factory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index a5d6fb789..403bfa5a3 100644 --- a/src/Composer/Factory.php +++ b/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); } } }