Merge pull request #31 from mremi/http-auth

Added extra option to configure HTTP authentication
This commit is contained in:
Francis Besset 2014-04-24 08:38:03 +02:00
commit dc6e1e0889
2 changed files with 6 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class Curl
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_password']); curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_password']);
} }
if (isset($options['login'])) { if (isset($options['login'])) {
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($this->ch, CURLOPT_HTTPAUTH, isset($options['extra_options']['http_auth']) ? $options['extra_options']['http_auth'] : CURLAUTH_ANY);
curl_setopt($this->ch, CURLOPT_USERPWD, $options['login'].':'.$options['password']); curl_setopt($this->ch, CURLOPT_USERPWD, $options['login'].':'.$options['password']);
} }
if (isset($options['local_cert'])) { if (isset($options['local_cert'])) {

View File

@ -113,6 +113,11 @@ class SoapClient extends \SoapClient
$this->cliWebserverWorkaround = $options['cli_webserver_workaround']; $this->cliWebserverWorkaround = $options['cli_webserver_workaround'];
} }
$this->curl = new Curl($options); $this->curl = new Curl($options);
if (isset($options['extra_options'])) {
unset($options['extra_options']);
}
$wsdlFile = $this->loadWsdl($wsdl, $options); $wsdlFile = $this->loadWsdl($wsdl, $options);
// TODO $wsdlHandler = new WsdlHandler($wsdlFile, $this->soapVersion); // TODO $wsdlHandler = new WsdlHandler($wsdlFile, $this->soapVersion);
$this->soapKernel = new SoapKernel(); $this->soapKernel = new SoapKernel();