浏览代码

fixed typo, removed tabs and renamed variable to zf coding styles

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19237 44c647ce-9c0f-0410-b52a-842ac1e357ba
bate 16 年之前
父节点
当前提交
80b8ff46d1
共有 1 个文件被更改,包括 23 次插入23 次删除
  1. 23 23
      library/Zend/Http/Client/Adapter/Curl.php

+ 23 - 23
library/Zend/Http/Client/Adapter/Curl.php

@@ -100,11 +100,11 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
 
     /**
      * Stream for storing output
-     * 
+     *
      * @var resource
      */
     protected $out_stream;
-    
+
     /**
      * Adapter constructor
      *
@@ -163,15 +163,15 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
         return $this;
     }
 
-	/**
- 	 * Retrieve the array of all configuration options
- 	 *
- 	 * @return array
- 	 */
- 	public function getConfig()
- 	{
- 	    return $this->_config;
- 	}
+    /**
+      * Retrieve the array of all configuration options
+      *
+      * @return array
+      */
+     public function getConfig()
+     {
+         return $this->_config;
+     }
 
     /**
      * Direct setter for cURL adapter related options.
@@ -258,7 +258,7 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
      * @return string        $request
      * @throws Zend_Http_Client_Adapter_Exception If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option
      */
-    public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+    public function write($method, $uri, $httpVersion = '1.1', $headers = array(), $body = '')
     {
         // Make sure we're properly connected
         if (!$this->_curl) {
@@ -302,16 +302,16 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
                             unset($headers[$k]);
                         }
                     }
-                    
+
                     if (!isset($this->_config['curloptions'][CURLOPT_INFILESIZE])) {
                         require_once 'Zend/Http/Client/Adapter/Exception.php';
                         throw new Zend_Http_Client_Adapter_Exception("Cannot set a file-handle for cURL option CURLOPT_INFILE without also setting its size in CURLOPT_INFILESIZE.");
                     }
-                    
+
                     if(is_resource($body)) {
                         $body = '';
                     }
-                    
+
                     $curlMethod = CURLOPT_PUT;
                 } else {
                     $curlMethod = CURLOPT_CUSTOMREQUEST;
@@ -344,9 +344,9 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
             require_once 'Zend/Http/Client/Adapter/Exception.php';
             throw new Zend_Http_Client_Adapter_Exception("Streaming requests are allowed only with PUT");
         }
-        
+
         // get http version to use
-        $curlHttp = ($http_ver = 1.1) ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_1_0;
+        $curlHttp = ($httpVersion == '1.1') ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_1_0;
 
         // mark as HTTP request and set HTTP method
         curl_setopt($this->_curl, $curlHttp, true);
@@ -357,7 +357,7 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
             curl_setopt($this->_curl, CURLOPT_HEADER, false);
             curl_setopt($this->_curl, CURLOPT_HEADERFUNCTION, array($this, "readHeader"));
             // and data will be written into the file
-            curl_setopt($this->_curl, CURLOPT_FILE, $this->out_stream);     
+            curl_setopt($this->_curl, CURLOPT_FILE, $this->out_stream);
         } else {
             // ensure headers are also returned
             curl_setopt($this->_curl, CURLOPT_HEADER, true);
@@ -403,7 +403,7 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
 
         // send the request
         $response = curl_exec($this->_curl);
-        
+
         // if we used streaming, headers are already there
         if(!is_resource($this->out_stream)) {
             $this->_response = $response;
@@ -476,19 +476,19 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac
 
     /**
      * Set output stream for the response
-     * 
+     *
      * @param resource $stream
      * @return Zend_Http_Client_Adapter_Socket
      */
-    public function setOutputStream($stream) 
+    public function setOutputStream($stream)
     {
         $this->out_stream = $stream;
         return $this;
     }
-    
+
     /**
      * Header reader function for CURL
-     * 
+     *
      * @param resource $curl
      * @param string $header
      * @return int