From 0994427a5b75bba964cd56142e7f5d34a79a2422 Mon Sep 17 00:00:00 2001 From: Arron Woods Date: Wed, 13 May 2015 15:57:56 +0100 Subject: Curl options must be an array --- library/SSRS/Report.php | 4 ++-- library/SSRS/Soap/NTLM.php | 17 ++++++++--------- 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); -- cgit v1.1