From b0d98b9301680be15aaf038d7aab3fd29cff8fbb Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 22 Apr 2024 21:12:57 +0200 Subject: [PATCH] Load ProxyManager before running command to fix autoload order (#11943) --- src/Composer/Console/Application.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 0eae431d1..1d34df527 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -379,6 +379,8 @@ class Application extends BaseApplication } try { + $proxyManager = ProxyManager::getInstance(); + if ($input->hasParameterOption('--profile')) { $startTime = microtime(true); $this->io->enableDebugging($startTime); @@ -400,7 +402,7 @@ class Application extends BaseApplication $io->writeError('Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MiB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MiB), time: '.round(microtime(true) - $startTime, 2).'s'); } - if (ProxyManager::getInstance()->needsTransitionWarning()) { + if ($proxyManager->needsTransitionWarning()) { $io->writeError(''); $io->writeError('Composer now requires separate proxy environment variables for HTTP and HTTPS requests.'); $io->writeError('Please set `https_proxy` in addition to your existing proxy environment variables.');