router cached) or others who see strange behavior. You're unlikely
to need this unless you're a developer.
+http
+----
+
+Settings for the HTTP client.
+
+ssl_cafile: location of the CA file for SSL. If not set, won't verify
+ SSL peers. Default unset.
+curl: Use cURL <http://curl.haxx.se/> for doing HTTP calls. You must
+ have the PHP curl extension installed for this to work.
+proxy_host: Host to use for proxying HTTP requests. If unset, doesn't
+ do any HTTP proxy stuff. Default unset.
+proxy_port: Port to use to connect to HTTP proxy host. Default null.
+proxy_user: Username to use for authenticating to the HTTP proxy. Default null.
+proxy_password: Password to use for authenticating to the HTTP proxy. Default null.
+proxy_auth_scheme: Scheme to use for authenticating to the HTTP proxy. Default null.
+
Plugins
=======
'http' => // HTTP client settings when contacting other sites
array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt')
'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
+ 'proxy_host' => null,
+ 'proxy_port' => null,
+ 'proxy_user' => null,
+ 'proxy_password' => null,
+ 'proxy_auth_scheme' => null,
),
'router' =>
array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
$this->config['adapter'] = 'HTTP_Request2_Adapter_Curl';
}
+ foreach (array('host', 'port', 'user', 'password', 'auth_scheme') as $cf) {
+ $k = 'proxy_'.$cf;
+ $v = common_config('http', $k);
+ if (!empty($v)) {
+ $this->config[$k] = $v;
+ }
+ }
+
parent::__construct($url, $method, $config);
$this->setHeader('User-Agent', $this->userAgent());
}