Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 716a98e

Browse files
committed
Added support for debuging the request performed by Guzzle
1 parent dde530f commit 716a98e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Symfony/Installer/DownloadCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,19 @@ protected function checkProjectName()
177177
*/
178178
protected function getGuzzleClient()
179179
{
180-
$options = array();
180+
$defaults = array();
181181

182182
// check if the client must use a proxy server
183183
if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) {
184184
$proxy = !empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY'];
185-
$options['proxy'] = $proxy;
185+
$defaults['proxy'] = $proxy;
186186
}
187187

188-
return new Client($options);
188+
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
189+
$defaults['debug'] = true;
190+
}
191+
192+
return new Client(array('defaults' => $defaults));
189193
}
190194

191195
/**
@@ -334,7 +338,7 @@ protected function getErrorMessage(\Requirement $requirement, $lineSize = 70)
334338
return;
335339
}
336340

337-
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
341+
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
338342
$errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
339343

340344
return $errorMessage;

0 commit comments

Comments
 (0)