From 477da3a448699c5f3753906f766a34e31b094188 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 10 Feb 2016 15:06:22 +0000 Subject: [PATCH] Fix clearCache in case of download failure --- src/Composer/Downloader/FileDownloader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index f0d4699b7..47b140c55 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -164,7 +164,7 @@ class FileDownloader implements DownloaderInterface } catch (\Exception $e) { // clean up $this->filesystem->removeDirectory($path); - $this->clearCache($package, $path); + $this->clearCache($package, $path, $processedUrl); throw $e; } @@ -181,11 +181,11 @@ class FileDownloader implements DownloaderInterface return $this; } - protected function clearCache(PackageInterface $package, $path) + protected function clearCache(PackageInterface $package, $path, $processedUrl) { if ($this->cache) { $fileName = $this->getFileName($package, $path); - $this->cache->remove($this->getCacheKey($package)); + $this->cache->remove($this->getCacheKey($package, $processedUrl)); } }