1
0
Fork 0

Merge branch '1.6'

pull/7402/head
Jordi Boggiano 2018-06-07 11:15:18 +02:00
commit 837ad7c14e
1 changed files with 9 additions and 4 deletions

View File

@ -56,10 +56,6 @@ class ZipDownloader extends ArchiveDownloader
self::$hasZipArchive = class_exists('ZipArchive'); self::$hasZipArchive = class_exists('ZipArchive');
} }
if (null === self::$isWindows) {
self::$isWindows = Platform::isWindows();
}
if (!self::$hasZipArchive && !self::$hasSystemUnzip) { if (!self::$hasZipArchive && !self::$hasSystemUnzip) {
// php.ini path is added to the error message to help users find the correct file // php.ini path is added to the error message to help users find the correct file
$iniMessage = IniHelper::getMessage(); $iniMessage = IniHelper::getMessage();
@ -68,6 +64,15 @@ class ZipDownloader extends ArchiveDownloader
throw new \RuntimeException($error); 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); return parent::download($package, $path, $output);
} }