summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArron Woods <aw@chartblocks.com>2015-05-13 15:57:56 +0100
committerArron Woods <aw@chartblocks.com>2015-05-13 15:57:56 +0100
commit0994427a5b75bba964cd56142e7f5d34a79a2422 (patch)
tree48504844e250a7f0973445e9fb1274f3335d880a
parente7743c4ab7d56847719cd6b558e6532204716668 (diff)
downloadphp-ssrs-0994427a5b75bba964cd56142e7f5d34a79a2422.zip
php-ssrs-0994427a5b75bba964cd56142e7f5d34a79a2422.tar.gz
php-ssrs-0994427a5b75bba964cd56142e7f5d34a79a2422.tar.bz2
Curl options must be an array
-rwxr-xr-xlibrary/SSRS/Report.php4
-rwxr-xr-xlibrary/SSRS/Soap/NTLM.php17
2 files changed, 10 insertions, 11 deletions
diff --git a/library/SSRS/Report.php b/library/SSRS/Report.php
index d888473..2333d3a 100755
--- a/library/SSRS/Report.php
+++ b/library/SSRS/Report.php
@@ -64,7 +64,7 @@ class Report {
public function setOptions(array $options) {
$defaults = array(
'cache_wsdl_path' => null,
- 'curl_options' => null,
+ 'curl_options' => array(),
);
$this->options = array_merge($defaults, $options);
@@ -458,7 +458,7 @@ class Report {
'username' => $this->_username,
'password' => $this->_passwd,
'cache_wsdl_path' => $this->options['cache_wsdl_path'],
- 'curl_options' => $this->options['curl_options'],
+ 'curl_options' => $this->options['curl_options'],
);
$client = new SoapNTLM($this->_baseUri . '/' . $path, $options);
diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php
index a48b33b..33b4fd6 100755
--- a/library/SSRS/Soap/NTLM.php
+++ b/library/SSRS/Soap/NTLM.php
@@ -13,7 +13,7 @@ class NTLM extends \SoapClient {
protected $_cacheExpiry;
protected $_lastRequest;
protected $_lastResponse;
- protected $_curlOptions;
+ protected $_curlOptions = array();
function __construct($wsdl, $options = array()) {
if (empty($options['cache_wsdl_path'])) {
@@ -117,15 +117,14 @@ class NTLM extends \SoapClient {
$this->cacheWSDL($wsdlContent);
}
}
-
- public function setCurlOptions($curl_options) {
- $this->_curlOptions = $curl_options;
+
+ public function setCurlOptions(array $curl_options) {
+ $this->_curlOptions = $curl_options;
}
-
+
public function getCurlOptions() {
- return $this->_curlOptions;
+ return $this->_curlOptions;
}
-
public function __doRequest($request, $location, $action, $version = 1, $one_way = null) {
$this->_lastRequest = (string) $request;
@@ -143,10 +142,10 @@ class NTLM extends \SoapClient {
curl_setopt($handle, CURLOPT_USERPWD, $this->_username . ':' . $this->_passwd);
curl_setopt($handle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
-
+
//set additional curl options
foreach ($this->getCurlOptions() as $key => $value) {
- curl_setopt($handle, $key, $value);
+ curl_setopt($handle, $key, $value);
}
$headers = $this->generateHeaders($url, $data, $action);