From 290a951cc3f1e5d96a14fb796990903a5bcad8b2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 13 Jul 2015 16:48:49 +0200 Subject: [PATCH 1/3] Added support for debuging the request performed by Guzzle (useful to spot issues) --- src/Symfony/Installer/DownloadCommand.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Installer/DownloadCommand.php b/src/Symfony/Installer/DownloadCommand.php index fc12cce..3f1add1 100644 --- a/src/Symfony/Installer/DownloadCommand.php +++ b/src/Symfony/Installer/DownloadCommand.php @@ -177,15 +177,20 @@ protected function checkProjectName() */ protected function getGuzzleClient() { - $options = array(); + $defaults = array(); // check if the client must use a proxy server if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) { $proxy = !empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY']; - $options['proxy'] = $proxy; + $defaults['proxy'] = $proxy; } - return new Client($options); + // enable request debugging if the command is in verbosity mode + if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + $defaults['debug'] = true; + } + + return new Client(array('defaults' => $defaults)); } /** From 039318c8dfca381297b363d98cf59a07883a34e7 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 26 Sep 2015 10:21:24 +0200 Subject: [PATCH 2/3] Changed the verbosity level --- src/Symfony/Installer/DownloadCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Installer/DownloadCommand.php b/src/Symfony/Installer/DownloadCommand.php index 3f1add1..a419308 100644 --- a/src/Symfony/Installer/DownloadCommand.php +++ b/src/Symfony/Installer/DownloadCommand.php @@ -185,8 +185,7 @@ protected function getGuzzleClient() $defaults['proxy'] = $proxy; } - // enable request debugging if the command is in verbosity mode - if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { + if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) { $defaults['debug'] = true; } From ba2db019435acefbcfc25be6892dc7432f933361 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 26 Sep 2015 10:22:13 +0200 Subject: [PATCH 3/3] Fixed syntax issues --- src/Symfony/Installer/DownloadCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Installer/DownloadCommand.php b/src/Symfony/Installer/DownloadCommand.php index a419308..7068d14 100644 --- a/src/Symfony/Installer/DownloadCommand.php +++ b/src/Symfony/Installer/DownloadCommand.php @@ -338,7 +338,7 @@ protected function getErrorMessage(\Requirement $requirement, $lineSize = 70) return; } - $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; + $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL; return $errorMessage;