1
0
Fork 0

Add 7-zip presence check to diagnose command

pull/9875/head
Jordi Boggiano 2021-06-02 13:39:26 +02:00
parent bec76367db
commit d864c5743a
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,7 @@ use Composer\Util\IniHelper;
use Composer\Util\ProcessExecutor;
use Composer\Util\HttpDownloader;
use Composer\Util\StreamContextFactory;
use Composer\Util\Platform;
use Composer\SelfUpdate\Keys;
use Composer\SelfUpdate\Versions;
use Composer\IO\NullIO;
@ -176,9 +177,17 @@ EOT
$finder = new ExecutableFinder;
$hasSystemUnzip = (bool) $finder->find('unzip');
if (Platform::isWindows()) {
$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(
'zip: ' . (extension_loaded('zip') ? '<comment>extension present</comment>' : '<comment>extension not loaded</comment>')
. ', ' . ($hasSystemUnzip ? '<comment>unzip present</comment>' : '<comment>unzip not available</comment>')
. $windows7z
);
return $this->exitCode;