diff --git a/src/Composer/Downloader/ZipDownloader.php b/src/Composer/Downloader/ZipDownloader.php
index d891fb33b..83b904a8a 100644
--- a/src/Composer/Downloader/ZipDownloader.php
+++ b/src/Composer/Downloader/ZipDownloader.php
@@ -104,9 +104,15 @@ class ZipDownloader extends ArchiveDownloader
throw $processError;
}
- $io->writeError(' '.$processError->getMessage().'');
- $io->writeError(' The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)');
- $io->writeError(' Unzip with unzip command failed, falling back to ZipArchive class');
+ if (!is_file($file)) {
+ $io->writeError(' '.$processError->getMessage().'');
+ $io->writeError(' This most likely is due to a custom installer plugin not handling the returned Promise from the downloader');
+ $io->writeError(' See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix');
+ } else {
+ $io->writeError(' '.$processError->getMessage().'');
+ $io->writeError(' The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)');
+ $io->writeError(' Unzip with unzip command failed, falling back to ZipArchive class');
+ }
return $self->extractWithZipArchive($package, $file, $path, true);
};
@@ -114,9 +120,12 @@ class ZipDownloader extends ArchiveDownloader
try {
$promise = $this->process->executeAsync($command);
- return $promise->then(function ($process) use ($tryFallback, $command, $package) {
+ return $promise->then(function ($process) use ($tryFallback, $command, $package, $file) {
if (!$process->isSuccessful()) {
- return $tryFallback(new \RuntimeException('Failed to extract '.$package->getName().': ('.$process->getExitCode().') '.$command."\n\n".$process->getErrorOutput()));
+ $output = $process->getErrorOutput();
+ $output = str_replace(', '.$file.'.zip or '.$file.'.ZIP', '', $output);
+
+ return $tryFallback(new \RuntimeException('Failed to extract '.$package->getName().': ('.$process->getExitCode().') '.$command."\n\n".$output));
}
});
} catch (\Exception $e) {