diff --git a/src/Composer/ComposerOrchestrator.php b/src/Composer/ComposerOrchestrator.php index 36677bcbc..4ef305b4c 100644 --- a/src/Composer/ComposerOrchestrator.php +++ b/src/Composer/ComposerOrchestrator.php @@ -131,7 +131,7 @@ public function dumpAutoload( public function getVendorDir(): string { - $vendorDirProcess = $this->processFactory->getAutoloadFileProcess(); + $vendorDirProcess = $this->processFactory->getVendorDirProcess(); $this->logger->info($vendorDirProcess->getCommandLine()); diff --git a/src/Composer/ComposerProcessFactory.php b/src/Composer/ComposerProcessFactory.php index d54169f4c..6afe7c495 100644 --- a/src/Composer/ComposerProcessFactory.php +++ b/src/Composer/ComposerProcessFactory.php @@ -49,12 +49,17 @@ public function __construct( public function getVersionProcess(): Process { - // Never use ANSI support here as we want to parse the raw output. - return $this->createProcess([ - $this->composerExecutable, - '--version', - '--no-ansi', - ]); + return $this->createProcess( + [ + $this->composerExecutable, + '--version', + // Never use ANSI support here as we want to parse the raw output. + '--no-ansi', + ], + // Ensure that even if this command gets executed within the app with --quiet it still + // works. + ['SHELL_VERBOSITY' => 0], + ); } public function getDumpAutoloaderProcess(bool $noDev): Process @@ -76,14 +81,20 @@ public function getDumpAutoloaderProcess(bool $noDev): Process return $this->createProcess($composerCommand); } - public function getAutoloadFileProcess(): Process + public function getVendorDirProcess(): Process { - return $this->createProcess([ - $this->composerExecutable, - 'config', - 'vendor-dir', - '--no-ansi', - ]); + return $this->createProcess( + [ + $this->composerExecutable, + 'config', + 'vendor-dir', + // Never use ANSI support here as we want to parse the raw output. + '--no-ansi', + ], + // Ensure that even if this command gets executed within the app with --quiet it still + // works. + ['SHELL_VERBOSITY' => 0], + ); } private function createProcess(array $command, array $environmentVariables = []): Process