From be4fcfebe135dcbab9ee142c799221b67294a710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 21 Oct 2023 01:02:06 +0200 Subject: [PATCH] fix: Ensure the PHP processes are restarted properly - Use the persistent setting: any sub-process should use the same settings. - Reset `COMPOSER_ORIGINAL_INIS` to avoid the buggy Flex code (see https://github.com/symfony/flex/pull/995). Closes #1089, #988. --- src/Composer/ComposerProcessFactory.php | 2 +- src/Console/Php/PhpSettingsHandler.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/ComposerProcessFactory.php b/src/Composer/ComposerProcessFactory.php index 074433a88..2ed84a84b 100644 --- a/src/Composer/ComposerProcessFactory.php +++ b/src/Composer/ComposerProcessFactory.php @@ -124,7 +124,7 @@ private static function retrieveSubProcessVerbosity(IO $io): ?string private static function getDefaultEnvVars(): array { - $vars = []; + $vars = ['COMPOSER_ORIGINAL_INIS' => '']; if ('1' === (string) getenv(BOX_ALLOW_XDEBUG)) { $vars['COMPOSER_ALLOW_XDEBUG'] = '1'; diff --git a/src/Console/Php/PhpSettingsHandler.php b/src/Console/Php/PhpSettingsHandler.php index c268c7444..ccec96722 100644 --- a/src/Console/Php/PhpSettingsHandler.php +++ b/src/Console/Php/PhpSettingsHandler.php @@ -47,6 +47,7 @@ public function __construct(LoggerInterface $logger) $this->logger = $logger; $this->pharReadonly = PharPhpSettings::isReadonly(); + $this->setPersistent(); } public function check(): void