From e94066967ce136c55e3c3a575e480fab34538c59 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 2 Mar 2016 18:28:44 +0000 Subject: [PATCH] Add debugging info about proxy usage, refs #4332 --- src/Composer/Util/RemoteFilesystem.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 048cc7b6e..7d37b5df3 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -228,7 +228,7 @@ class RemoteFilesystem unset($tempAdditionalOptions); $userlandFollow = isset($options['http']['follow_location']) && !$options['http']['follow_location']; - $this->io->writeError((substr($fileUrl, 0, 4) === 'http' ? 'Downloading ' : 'Reading ') . $fileUrl, true, IOInterface::DEBUG); + $origFileUrl = $fileUrl; if (isset($options['github-token'])) { $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token']; @@ -251,6 +251,11 @@ class RemoteFilesystem $ctx = StreamContextFactory::getContext($fileUrl, $options, array('notification' => array($this, 'callbackGet'))); + $actualContextOptions = stream_context_get_options($ctx); + $usingProxy = !empty($actualContextOptions['http']['proxy']) ? ' using proxy ' . $actualContextOptions['http']['proxy'] : ''; + $this->io->writeError((substr($origFileUrl, 0, 4) === 'http' ? 'Downloading ' : 'Reading ') . $origFileUrl . $usingProxy, true, IOInterface::DEBUG); + unset($origFileUrl, $actualContextOptions); + if ($this->progress && !$isRedirect) { $this->io->writeError(" Downloading: Connecting...", false); }