diff --git a/src/Symfony/Installer/DownloadCommand.php b/src/Symfony/Installer/DownloadCommand.php index 836f6f1..e38f0ec 100644 --- a/src/Symfony/Installer/DownloadCommand.php +++ b/src/Symfony/Installer/DownloadCommand.php @@ -19,6 +19,7 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Event\ProgressEvent; +use GuzzleHttp\Utils; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; @@ -221,7 +222,15 @@ protected function getGuzzleClient() $defaults['debug'] = true; } - return new Client(array('defaults' => $defaults)); + try { + $handler = Utils::getDefaultHandler(); + } catch (\RuntimeException $e) { + throw new \RuntimeException( + 'The Symfony installer requires the php-curl extension or the allow_url_fopen ini setting.' + ); + } + + return new Client(array('defaults' => $defaults, 'handler' => $handler)); } /**