Permalink
Browse files

Merge branch '1.6'

  • Loading branch information...
Seldaek committed Jun 7, 2018
2 parents 1dd2e6f + 5bae191 commit 837ad7c14e8ce364296e0d0600d04c415b6e359d
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/Composer/Downloader/ZipDownloader.php
@@ -56,10 +56,6 @@ public function download(PackageInterface $package, $path, $output = true)
self::$hasZipArchive = class_exists('ZipArchive');
}
- if (null === self::$isWindows) {
- self::$isWindows = Platform::isWindows();
- }
-
if (!self::$hasZipArchive && !self::$hasSystemUnzip) {
// php.ini path is added to the error message to help users find the correct file
$iniMessage = IniHelper::getMessage();
@@ -68,6 +64,15 @@ public function download(PackageInterface $package, $path, $output = true)
throw new \RuntimeException($error);
}
+ if (null === self::$isWindows) {
+ self::$isWindows = Platform::isWindows();
+
+ if (!self::$isWindows && !self::$hasSystemUnzip) {
+ $this->io->writeError("<warn>As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.</warn>");
+ $this->io->writeError("<warn>This may cause invalid reports of corrupted archives. Installing 'unzip' may remediate them.</warn>");
+ }
+ }
+
return parent::download($package, $path, $output);
}

0 comments on commit 837ad7c

Please sign in to comment.