Add 7-zip presence check to diagnose command
parent
bec76367db
commit
d864c5743a
|
@ -24,6 +24,7 @@ use Composer\Util\IniHelper;
|
||||||
use Composer\Util\ProcessExecutor;
|
use Composer\Util\ProcessExecutor;
|
||||||
use Composer\Util\HttpDownloader;
|
use Composer\Util\HttpDownloader;
|
||||||
use Composer\Util\StreamContextFactory;
|
use Composer\Util\StreamContextFactory;
|
||||||
|
use Composer\Util\Platform;
|
||||||
use Composer\SelfUpdate\Keys;
|
use Composer\SelfUpdate\Keys;
|
||||||
use Composer\SelfUpdate\Versions;
|
use Composer\SelfUpdate\Versions;
|
||||||
use Composer\IO\NullIO;
|
use Composer\IO\NullIO;
|
||||||
|
@ -176,9 +177,17 @@ 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'));
|
||||||
|
$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
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->exitCode;
|
return $this->exitCode;
|
||||||
|
|
Loading…
Reference in New Issue