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

main
Jordi Boggiano 12 years ago
commit 16a9839688

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

Loading…
Cancel
Save