Horde_Push_Factory_Recipients::_createHttpClient PHP Method

_createHttpClient() private method

Create a HTTP client.
private _createHttpClient ( array $conf ) : Horde_Http_Client
$conf array The configuration.
return Horde_Http_Client The HTTP client.
    private function _createHttpClient($conf)
    {
        $client_opts = array();
        if (!empty($conf['http']['proxy']['proxy_host'])) {
            $client_opts['request.proxyServer'] = $conf['http']['proxy']['proxy_host'];
            $client_opts['request.proxyPort'] = $conf['http']['proxy']['proxy_port'];
            if (!empty($conf['http']['proxy']['proxy_user'])) {
                $client_opts['request.proxyUsername'] = $conf['http']['proxy']['proxy_user'];
                if (!empty($conf['http']['proxy']['proxy_pass'])) {
                    $client_opts['request.proxyPassword'] = $conf['http']['proxy']['proxy_pass'];
                }
            }
        }
        return new Horde_Http_Client($client_opts);
    }