patch for setting options for curl
| From: | Peter Clarke | Date: | Wed, 19 Feb 2003 12:55:35 +0000 |
| Subject: | patch for setting options for curl | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-429@lists.php.net to get a copy of this message | ||
I need to be able to tell curl not to check certificates and have the option of a verbose output, so I've made the following patch to SOAP/Transport/HTTP.php
+++ HTTP.php Wed Feb 19 12:26:29 2003@@ -360,7 +360,12 @@
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
+ if (isset($options['CURLOPT'])) {
+ reset ($options['CURLOPT']);
+ while (list ($key, $val) = each ($options['CURLOPT'])) {
+ curl_setopt($ch, $key, $val);
+ }
+ }
$this->response = curl_exec($ch);
curl_close($ch);
I then set my options like this:
$sc = new SOAP_Client($endpoint);
$sc->__options['CURLOPT'][CURLOPT_VERBOSE] = 0;
$sc->__options['CURLOPT'][CURLOPT_SSL_VERIFYHOST] = 0;
$sc->__options['CURLOPT'][CURLOPT_SSL_VERIFYPEER] = 0;
Please apply to PEAR::SOAP repository.
Thanks
Peter