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

Added support for debuging the request performed by Guzzle #177

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Symfony/Installer/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,19 @@ 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);
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
$defaults['debug'] = true;
}

return new Client(array('defaults' => $defaults));
}

/**
Expand Down Expand Up @@ -334,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;
Expand Down