Fix support for 7z command fallback on linux/macOS, fixes #9994
parent
bacbd15b6b
commit
db1d9e75be
|
@ -177,17 +177,12 @@ EOT
|
||||||
|
|
||||||
$finder = new ExecutableFinder;
|
$finder = new ExecutableFinder;
|
||||||
$hasSystemUnzip = (bool) $finder->find('unzip');
|
$hasSystemUnzip = (bool) $finder->find('unzip');
|
||||||
if (Platform::isWindows()) {
|
|
||||||
$hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip'));
|
$hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip'));
|
||||||
$windows7z = ', ' . ($hasSystem7zip ? '<comment>7-Zip present</comment>' : '<comment>7-Zip not available</comment>');
|
|
||||||
} else {
|
|
||||||
$windows7z = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$io->write(
|
$io->write(
|
||||||
'zip: ' . (extension_loaded('zip') ? '<comment>extension present</comment>' : '<comment>extension not loaded</comment>')
|
'zip: ' . (extension_loaded('zip') ? '<comment>extension present</comment>' : '<comment>extension not loaded</comment>')
|
||||||
. ', ' . ($hasSystemUnzip ? '<comment>unzip present</comment>' : '<comment>unzip not available</comment>')
|
. ', ' . ($hasSystemUnzip ? '<comment>unzip present</comment>' : '<comment>unzip not available</comment>')
|
||||||
. $windows7z
|
. ', ' . ($hasSystem7zip ? '<comment>7-Zip present</comment>' : '<comment>7-Zip not available</comment>')
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->exitCode;
|
return $this->exitCode;
|
||||||
|
|
|
@ -46,6 +46,9 @@ class ZipDownloader extends ArchiveDownloader
|
||||||
if ($cmd = $finder->find('unzip')) {
|
if ($cmd = $finder->find('unzip')) {
|
||||||
self::$unzipCommands[] = array('unzip', ProcessExecutor::escape($cmd).' -qq %s -d %s');
|
self::$unzipCommands[] = array('unzip', ProcessExecutor::escape($cmd).' -qq %s -d %s');
|
||||||
}
|
}
|
||||||
|
if (!Platform::isWindows() && ($cmd = $finder->find('7z'))) { // 7z linux/macOS support is only used if unzip is not present
|
||||||
|
self::$unzipCommands[] = array('7z', ProcessExecutor::escape($cmd).' x -bb0 -y %s -o%s');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === self::$hasZipArchive) {
|
if (null === self::$hasZipArchive) {
|
||||||
|
|
Loading…
Reference in New Issue