@ -56,7 +55,7 @@ class ZipDownloader extends ArchiveDownloader
if (!self::$hasZipArchive && !self::$unzipCommands) {
// php.ini path is added to the error message to help users find the correct file
$iniMessage = IniHelper::getMessage();
$error = "The zip extension and unzip command are both missing, skipping.\n" . $iniMessage;
$error = "The zip extension and unzip/7z commands are both missing, skipping.\n" . $iniMessage;
throw new \RuntimeException($error);
}
@ -65,9 +64,9 @@ class ZipDownloader extends ArchiveDownloader
self::$isWindows = Platform::isWindows();
if (!self::$isWindows && !self::$unzipCommands) {
$this->io->writeError("<warning>As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.</warning>");
$this->io->writeError("<warning>As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.</warning>");
$this->io->writeError("<warning>This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.</warning>");
$this->io->writeError("<warning>Installing 'unzip' may remediate them.</warning>");
$this->io->writeError("<warning>Installing 'unzip' or '7z' may remediate them.</warning>");
}
}
@ -79,89 +78,59 @@ class ZipDownloader extends ArchiveDownloader
*
* @param string $file File to extract
* @param string $path Path where to extract file
* @param bool $isLastChance If true it is called as a fallback and should throw an exception
* @return PromiseInterface
*/
private function extractWithSystemUnzip(PackageInterface $package, $file, $path, $isLastChance, $async = false)
private function extractWithSystemUnzip(PackageInterface $package, $file, $path)
{
if (!self::$hasZipArchive) {
// Force Exception throwing if the Other alternative is not available
$isLastChance = true;
}
// Force Exception throwing if the other alternative extraction method is not available
$isLastChance = !self::$hasZipArchive;
if (!self::$unzipCommands&& !$isLastChance) {
if (!self::$unzipCommands) {
// This was call as the favorite extract way, but is not available
Installing dependencies from lock file (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals%(\nAs there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.\nThis may cause invalid reports of corrupted archives. Besides, any UNIX permissions \(e.g. executable\) defined in the archives will be lost.\nInstalling 'unzip' may remediate them.)?%
Package operations: 6 installs, 0 updates, 0 removals%(\nAs there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.\nThis may cause invalid reports of corrupted archives. Besides, any UNIX permissions \(e.g. executable\) defined in the archives will be lost.\nInstalling 'unzip' or '7z' may remediate them.)?%
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 5 updates, 0 removals%(\nAs there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.\nThis may cause invalid reports of corrupted archives. Besides, any UNIX permissions \(e.g. executable\) defined in the archives will be lost.\nInstalling 'unzip' may remediate them.)?%
Package operations: 0 installs, 5 updates, 0 removals%(\nAs there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.\nThis may cause invalid reports of corrupted archives. Besides, any UNIX permissions \(e.g. executable\) defined in the archives will be lost.\nInstalling 'unzip' or '7z' may remediate them.)?%