Skip to content

Commit

Permalink
Load ProxyManager before running command to fix autoload order (#11943)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Apr 22, 2024
1 parent 9f84f0c commit b0d98b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Composer/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow
}

try {
$proxyManager = ProxyManager::getInstance();

if ($input->hasParameterOption('--profile')) {
$startTime = microtime(true);
$this->io->enableDebugging($startTime);
Expand All @@ -400,7 +402,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow
$io->writeError('<info>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('<warning>Composer now requires separate proxy environment variables for HTTP and HTTPS requests.</warning>');
$io->writeError('<warning>Please set `https_proxy` in addition to your existing proxy environment variables.</warning>');
Expand Down

0 comments on commit b0d98b9

Please sign in to comment.