1
0
Fork 0

Also look up 7zz on linux/macOS, fixes #9951

pull/10002/head
Jordi Boggiano 2021-07-12 15:50:02 +02:00
parent b602b19f6d
commit be58b36a35
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 11 additions and 2 deletions

View File

@ -177,12 +177,18 @@ EOT
$finder = new ExecutableFinder; $finder = new ExecutableFinder;
$hasSystemUnzip = (bool) $finder->find('unzip'); $hasSystemUnzip = (bool) $finder->find('unzip');
$hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip')); $bin7zip = '';
if ($hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip'))) {
$bin7zip = '7z';
}
if (!Platform::isWindows() && !$hasSystem7zip && $hasSystem7zip = (bool) $finder->find('7zz')) {
$bin7zip = '7zz';
}
$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>')
. ', ' . ($hasSystem7zip ? '<comment>7-Zip present</comment>' : '<comment>7-Zip not available</comment>') . ', ' . ($hasSystem7zip ? '<comment>7-Zip present ('.$bin7zip.')</comment>' : '<comment>7-Zip not available</comment>')
); );
return $this->exitCode; return $this->exitCode;

View File

@ -49,6 +49,9 @@ class ZipDownloader extends ArchiveDownloader
if (!Platform::isWindows() && ($cmd = $finder->find('7z'))) { // 7z linux/macOS support is only used if unzip is not present 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'); self::$unzipCommands[] = array('7z', ProcessExecutor::escape($cmd).' x -bb0 -y %s -o%s');
} }
if (!Platform::isWindows() && ($cmd = $finder->find('7zz'))) { // 7zz linux/macOS support is only used if unzip is not present
self::$unzipCommands[] = array('7zz', ProcessExecutor::escape($cmd).' x -bb0 -y %s -o%s');
}
} }
if (null === self::$hasZipArchive) { if (null === self::$hasZipArchive) {