From de2bc2d31a3bd322030307526139792e68f820a8 Mon Sep 17 00:00:00 2001 From: Aaron Bauman Date: Fri, 28 Sep 2012 10:54:21 -0400 Subject: [PATCH] adding user-supplied "soap_options" to createConnection in SforceBaseClient.php to allow pass-thru options to SoapClient instantiation --- soapclient/SforceBaseClient.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/soapclient/SforceBaseClient.php b/soapclient/SforceBaseClient.php index ded6e78..c19533c 100644 --- a/soapclient/SforceBaseClient.php +++ b/soapclient/SforceBaseClient.php @@ -98,17 +98,22 @@ public function printDebugInfo() { * Connect method to www.salesforce.com * * @param string $wsdl Salesforce.com Partner WSDL + * @param object $proxy (optional) proxy settings with properties host, port, + * login and password + * @param array $soap_options (optional) Additional options to send to the + * SoapClient constructor. @see + * http://php.net/manual/en/soapclient.soapclient.php */ - public function createConnection($wsdl, $proxy=null) { + public function createConnection($wsdl, $proxy=null, $soap_options=array()) { $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-')); - $soapClientArray = array ( + $soapClientArray = array_merge(array ( 'user_agent' => 'salesforce-toolkit-php/'.$this->version, 'encoding' => 'utf-8', 'trace' => 1, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP - ); + ), $soap_options); // We don't need to parse out any subversion suffix - e.g. "-01" since // PHP type conversion will ignore it