web/lib/Zend/Http/Client/Adapter/Curl.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    14  * to license@zend.com so we can send you a copy immediately.
    14  * to license@zend.com so we can send you a copy immediately.
    15  *
    15  *
    16  * @category   Zend
    16  * @category   Zend
    17  * @package    Zend_Http
    17  * @package    Zend_Http
    18  * @subpackage Client_Adapter
    18  * @subpackage Client_Adapter
    19  * @version    $Id: Curl.php 22216 2010-05-20 21:12:05Z dragonbe $
    19  * @version    $Id: Curl.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    20  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    21  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    21  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @see Zend_Uri_Http
    25  * @see Zend_Uri_Http
    40  * Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl
    40  * Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl
    41  *
    41  *
    42  * @category   Zend
    42  * @category   Zend
    43  * @package    Zend_Http
    43  * @package    Zend_Http
    44  * @subpackage Client_Adapter
    44  * @subpackage Client_Adapter
    45  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    45  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    47  */
    47  */
    48 class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interface, Zend_Http_Client_Adapter_Stream
    48 class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interface, Zend_Http_Client_Adapter_Stream
    49 {
    49 {
    50     /**
    50     /**
   332 
   332 
   333             case Zend_Http_Client::TRACE:
   333             case Zend_Http_Client::TRACE:
   334                 $curlMethod = CURLOPT_CUSTOMREQUEST;
   334                 $curlMethod = CURLOPT_CUSTOMREQUEST;
   335                 $curlValue = "TRACE";
   335                 $curlValue = "TRACE";
   336                 break;
   336                 break;
   337             
   337 
   338             case Zend_Http_Client::HEAD:
   338             case Zend_Http_Client::HEAD:
   339                 $curlMethod = CURLOPT_CUSTOMREQUEST;
   339                 $curlMethod = CURLOPT_CUSTOMREQUEST;
   340                 $curlValue = "HEAD";
   340                 $curlValue = "HEAD";
   341                 break;
   341                 break;
   342 
   342 
   391             unset($this->_config['curloptions'][CURLOPT_INFILE]);
   391             unset($this->_config['curloptions'][CURLOPT_INFILE]);
   392             unset($this->_config['curloptions'][CURLOPT_INFILESIZE]);
   392             unset($this->_config['curloptions'][CURLOPT_INFILESIZE]);
   393         } elseif ($method == Zend_Http_Client::PUT) {
   393         } elseif ($method == Zend_Http_Client::PUT) {
   394             // This is a PUT by a setRawData string, not by file-handle
   394             // This is a PUT by a setRawData string, not by file-handle
   395             curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
   395             curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
       
   396         } elseif ($method == Zend_Http_Client::DELETE) {
       
   397             // This is a DELETE by a setRawData string
       
   398             curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
   396         }
   399         }
   397 
   400 
   398         // set additional curl options
   401         // set additional curl options
   399         if (isset($this->_config['curloptions'])) {
   402         if (isset($this->_config['curloptions'])) {
   400             foreach ((array)$this->_config['curloptions'] as $k => $v) {
   403             foreach ((array)$this->_config['curloptions'] as $k => $v) {