From 6bf136489fc4b6f79099b020c9b339528e46139c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 12 Oct 2020 10:53:35 +0200 Subject: [PATCH] Ignore the COMPOSER env var when executing global scope commands, fixes #9259 --- src/Composer/Command/GlobalCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Composer/Command/GlobalCommand.php b/src/Composer/Command/GlobalCommand.php index 64c7523a3..958643dee 100644 --- a/src/Composer/Command/GlobalCommand.php +++ b/src/Composer/Command/GlobalCommand.php @@ -75,6 +75,12 @@ EOT return parent::run($input, $output); } + // The COMPOSER env var should not apply to the global execution scope + if (getenv('COMPOSER')) { + putenv('COMPOSER'); + unset($_SERVER['COMPOSER']); + } + // change to global dir $config = Factory::createConfig(); $home = $config->get('home');