[SoapClient] Add possiblity to disable proxy if present in environment variable

This commit is contained in:
Francis Besset
2014-08-14 11:18:46 +02:00
parent b3c6353af8
commit c24e8775bf
3 changed files with 23 additions and 8 deletions

View File

@ -81,8 +81,13 @@ class Curl
curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $options['connection_timeout']);
}
if (isset($options['proxy_host'])) {
$port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;
curl_setopt($this->ch, CURLOPT_PROXY, $options['proxy_host'] . ':' . $port);
if (false !== $options['proxy_host']) {
$proxyHost = $options['proxy_host'].(isset($options['proxy_port']) ? $options['proxy_port'] : 8080);
} else {
$proxyHost = false;
}
curl_setopt($this->ch, CURLOPT_PROXY, $proxyHost);
}
if (isset($options['proxy_user'])) {
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_password']);
@ -310,4 +315,4 @@ class Curl
return trim(array_pop($matches));
}
}
}