function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Park Walker (TAGL)Park Walker (TAGL) 

Code change request

I'm not sure who's maintaining the toolkit at this point, but I'd like to ask for a small code change. The current createConnection method overwrites the existing HTTP_USER_AGENT value which doesn't play well with other code that relies on this value, FirePHP being one example.

 

Proposed change:

 

 

/** * Connect method to www.salesforce.com * Preserves the current HTTP_USER_AGENT * * @param string $wsdl Salesforce.com Partner WSDL */ public function createConnection($wsdl, $proxy=null) { $agent = $_SERVER['HTTP_USER_AGENT']; $_SERVER['HTTP_USER_AGENT'] = 'Salesforce/PHPToolkit/1.0'; $soapClientArray = null; if (phpversion() > '5.1.2') { $soapClientArray = array ( 'encoding' => 'utf-8', 'trace' => 1, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP ); } else { $soapClientArray = array ( 'encoding' => 'utf-8', 'trace' => 1 ); } if ($proxy != null) { $proxySettings = array(); $proxySettings['proxy_host'] = $proxy->host; $proxySettings['proxy_port'] = $proxy->port; // Use an integer, not a string $proxySettings['proxy_login'] = $proxy->login; $proxySettings['proxy_password'] = $proxy->password; $soapClientArray = array_merge($soapClientArray, $proxySettings); } $this->sforce = new SoapClient($wsdl, $soapClientArray); $_SERVER['HTTP_USER_AGENT'] = $agent; return $this->sforce; }

 

 Thanks,

Park