Symfony\Installer\DownloadCommand::getGuzzleClient PHP Method

getGuzzleClient() protected method

Returns the Guzzle client configured according to the system environment (e.g. it takes into account whether it should use a proxy server or not).
protected getGuzzleClient ( ) : Client
return GuzzleHttp\Client The configured Guzzle client
    protected function getGuzzleClient()
    {
        $defaults = array();
        // check if the client must use a proxy server
        if (!empty($_SERVER['HTTP_PROXY']) || !empty($_SERVER['http_proxy'])) {
            $defaults['proxy'] = !empty($_SERVER['http_proxy']) ? $_SERVER['http_proxy'] : $_SERVER['HTTP_PROXY'];
        }
        if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
            $defaults['debug'] = true;
        }
        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));
    }