Skip to content

Commit

Permalink
Make sure diagnose command can run without proc_open, refs #9253
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Aug 18, 2021
1 parent 60fe670 commit d465df4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Composer/Command/DiagnoseCommand.php
Expand Up @@ -189,6 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'zip: ' . (extension_loaded('zip') ? '<comment>extension present</comment>' : '<comment>extension not loaded</comment>')
. ', ' . ($hasSystemUnzip ? '<comment>unzip present</comment>' : '<comment>unzip not available</comment>')
. ', ' . ($hasSystem7zip ? '<comment>7-Zip present ('.$bin7zip.')</comment>' : '<comment>7-Zip not available</comment>')
. (($hasSystem7zip || $hasSystemUnzip) && !function_exists('proc_open') ? ', <warning>proc_open is disabled or not present, unzip/7-z will not be usable</warning>' : '')
);

return $this->exitCode;
Expand Down Expand Up @@ -220,6 +221,10 @@ private function checkComposerSchema()

private function checkGit()
{
if (!function_exists('proc_open')) {
return '<comment>proc_open is not available, git cannot be used</comment>';
}

$this->process->execute('git config color.ui', $output);
if (strtolower(trim($output)) === 'always') {
return '<comment>Your git color.ui setting is set to always, this is known to create issues. Use "git config --global color.ui true" to set it correctly.</comment>';
Expand Down

0 comments on commit d465df4

Please sign in to comment.