Skip to content
This repository

Rename Zend\Http accessors to get*() style #1690

Merged
merged 16 commits into from almost 2 years ago

2 participants

Jurian Sluiman Matthew Weier O'Phinney
Jurian Sluiman

All Zend\Http\Request and Zend\Http\Response methods like query() and post() change with this PR to getQuery() and getPost(). All tests from Zend\Http and all other components are adjusted to reflect these changes.

Because of many failures in components the Travis tests say also in this case the build did not pass. However, if you read all failures from this build you see nothing is Zend\Http related.

Jurian Sluiman

The build passed for php 5.3.3 and 5.3. Travis has problems with the virtual machine of php 5.4. Link to Travis build: http://travis-ci.org/#!/juriansluiman/zf2/builds/1744464

Matthew Weier O'Phinney weierophinney merged commit 7a5b6c7 into from June 30, 2012
Matthew Weier O'Phinney weierophinney closed this June 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 60 changed files with 393 additions and 441 deletions. Show diff stats Hide diff stats

  1. 10  library/Zend/Authentication/Adapter/Http.php
  2. 10  library/Zend/GData/App.php
  3. 4  library/Zend/GData/YouTube.php
  4. 42  library/Zend/Http/Client.php
  5. 4  library/Zend/Http/Client/Adapter/Proxy.php
  6. 36  library/Zend/Http/Client/Adapter/Socket.php
  7. 6  library/Zend/Http/Client/Adapter/StreamInterface.php
  8. 10  library/Zend/Http/Client/Cookies.php
  9. 34  library/Zend/Http/ClientStatic.php
  10. 53  library/Zend/Http/Cookies.php
  11. 2  library/Zend/Http/Exception/RuntimeException.php
  12. 8  library/Zend/Http/Headers.php
  13. 80  library/Zend/Http/PhpEnvironment/Request.php
  14. 14  library/Zend/Http/PhpEnvironment/Response.php
  15. 28  library/Zend/Http/Request.php
  16. 12  library/Zend/Http/Response.php
  17. 44  library/Zend/Http/Response/Stream.php
  18. 4  library/Zend/Json/Server/Client.php
  19. 8  library/Zend/Mvc/Controller/AbstractRestfulController.php
  20. 4  library/Zend/Mvc/Controller/Plugin/Params.php
  21. 4  library/Zend/Mvc/Controller/Plugin/Redirect.php
  22. 4  library/Zend/Mvc/Router/Http/Hostname.php
  23. 4  library/Zend/Mvc/Router/Http/Literal.php
  24. 4  library/Zend/Mvc/Router/Http/Part.php
  25. 4  library/Zend/Mvc/Router/Http/Query.php
  26. 4  library/Zend/Mvc/Router/Http/Regex.php
  27. 4  library/Zend/Mvc/Router/Http/Scheme.php
  28. 4  library/Zend/Mvc/Router/Http/Segment.php
  29. 4  library/Zend/Mvc/Router/Http/TreeRouteStack.php
  30. 4  library/Zend/Mvc/Router/Http/Wildcard.php
  31. 14  library/Zend/OAuth/Client.php
  32. 4  library/Zend/OAuth/Http/RequestToken.php
  33. 2  library/Zend/OAuth/OAuth.php
  34. 5  library/Zend/OpenId/OpenId.php
  35. 12  library/Zend/Rest/Client/RestClient.php
  36. 38  library/Zend/Service/Rackspace/Rackspace.php
  37. 6  library/Zend/View/Helper/Json.php
  38. 4  library/Zend/View/Strategy/FeedStrategy.php
  39. 6  library/Zend/View/Strategy/JsonStrategy.php
  40. 4  library/Zend/XmlRpc/Client.php
  41. 4  tests/Zend/Authentication/Adapter/Http/AuthTest.php
  42. 2  tests/Zend/Authentication/Adapter/Http/ProxyTest.php
  43. 14  tests/Zend/Http/ClientTest.php
  44. 4  tests/Zend/Http/PhpEnvironment/RequestTest.php
  45. 38  tests/Zend/Http/RequestTest.php
  46. 34  tests/Zend/Http/Response/ResponseStreamTest.php
  47. 28  tests/Zend/Http/ResponseTest.php
  48. 2  tests/Zend/Json/Server/ClientTest.php
  49. 4  tests/Zend/Mvc/Controller/Plugin/ParamsTest.php
  50. 4  tests/Zend/Mvc/Controller/Plugin/RedirectTest.php
  51. 2  tests/Zend/Mvc/Controller/RestfulControllerTest.php
  52. 30  tests/Zend/OAuth/OAuthTest.php
  53. 12  tests/Zend/OpenId/ConsumerTest.php
  54. 12  tests/Zend/OpenId/OpenIdTest.php
  55. 62  tests/Zend/OpenId/ProviderTest.php
  56. 2  tests/Zend/View/Helper/JsonTest.php
  57. 12  tests/Zend/View/Strategy/FeedStrategyTest.php
  58. 12  tests/Zend/View/Strategy/JsonStrategyTest.php
  59. 6  tests/Zend/View/Strategy/PhpRendererStrategyTest.php
  60. 2  tests/Zend/XmlRpc/ClientTest.php
10  library/Zend/Authentication/Adapter/Http.php
@@ -348,7 +348,7 @@ public function authenticate()
348 348
             $getHeader = 'Authorization';
349 349
         }
350 350
 
351  
-        $headers = $this->_request->headers();
  351
+        $headers = $this->_request->getHeaders();
352 352
         if (!$headers->has($getHeader)) {
353 353
             return $this->_challengeClient();
354 354
         }
@@ -412,7 +412,7 @@ protected function _challengeClient()
412 412
         $this->_response->setStatusCode($statusCode);
413 413
 
414 414
         // Send a challenge in each acceptable authentication scheme
415  
-        $headers = $this->_response->headers();
  415
+        $headers = $this->_response->getHeaders();
416 416
         if (in_array('basic', $this->_acceptSchemes)) {
417 417
             $headers->addHeaderLine($headerName, $this->_basicHeader());
418 418
         }
@@ -614,7 +614,7 @@ protected function _calcNonce()
614 614
         // would be surprising if the user just logged in.
615 615
         $timeout = ceil(time() / $this->_nonceTimeout) * $this->_nonceTimeout;
616 616
 
617  
-        $nonce = hash('md5', $timeout . ':' . $this->_request->server()->get('HTTP_USER_AGENT') . ':' . __CLASS__);
  617
+        $nonce = hash('md5', $timeout . ':' . $this->_request->getServer()->get('HTTP_USER_AGENT') . ':' . __CLASS__);
618 618
         return $nonce;
619 619
     }
620 620
 
@@ -688,7 +688,7 @@ protected function _parseDigestAuth($header)
688 688
         // Section 3.2.2.5 in RFC 2617 says the authenticating server must
689 689
         // verify that the URI field in the Authorization header is for the
690 690
         // same resource requested in the Request Line.
691  
-        $rUri = $this->_request->uri();
  691
+        $rUri = $this->_request->getUri();
692 692
         $cUri = UriFactory::factory($temp[1]);
693 693
 
694 694
         // Make sure the path portion of both URIs is the same
@@ -744,7 +744,7 @@ protected function _parseDigestAuth($header)
744 744
             if (!$ret || empty($temp[1])) {
745 745
 
746 746
                 // Big surprise: IE isn't RFC 2617-compliant.
747  
-                $headers = $this->_request->headers();
  747
+                $headers = $this->_request->getHeaders();
748 748
                 if (!$headers->has('User-Agent')) {
749 749
                     return false;
750 750
                 }
10  library/Zend/GData/App.php
@@ -241,7 +241,7 @@ public function setHttpClient(Http\Client $client = null, $applicationId = 'MyCo
241 241
 
242 242
         $userAgent = $applicationId . ' Zend_Framework_Gdata/' .
243 243
             \Zend\Version::VERSION;
244  
-        $client->getRequest()->headers()->addHeaderLine('User-Agent', $userAgent);
  244
+        $client->getRequest()->getHeaders()->addHeaderLine('User-Agent', $userAgent);
245 245
         $client->setOptions(array(
246 246
             'strictredirects' => true
247 247
             )
@@ -750,7 +750,7 @@ public function importUrl($url, $className='Zend\GData\App\Feed',
750 750
             return $feedContent;
751 751
         }
752 752
 
753  
-        $header = $response->headers()->get('GData-Version');
  753
+        $header = $response->getHeaders()->get('GData-Version');
754 754
         $majorProtocolVersion = null;
755 755
         $minorProtocolVersion = null;
756 756
         if ($header instanceof Http\Header\HeaderInterface) {
@@ -769,7 +769,7 @@ public function importUrl($url, $className='Zend\GData\App\Feed',
769 769
         if ($this->getHttpClient() != null) {
770 770
             $feed->setHttpClient($this->getHttpClient());
771 771
         }
772  
-        $etag = $response->headers()->get('ETag');
  772
+        $etag = $response->getHeaders()->get('ETag');
773 773
         if ($etag instanceof Etag) {
774 774
             $feed->setEtag($etag);
775 775
         }
@@ -956,7 +956,7 @@ public function insertEntry($data, $uri, $className='Zend\GData\App\Entry',
956 956
         $returnEntry = new $className($response->getBody());
957 957
         $returnEntry->setHttpClient(self::getstaticHttpClient());
958 958
 
959  
-        $etag = $response->headers()->get('ETag');
  959
+        $etag = $response->getHeaders()->get('ETag');
960 960
         if ($etag instanceof Etag) {
961 961
             $returnEntry->setEtag($etag);
962 962
         }
@@ -995,7 +995,7 @@ public function updateEntry($data, $uri = null, $className = null,
995 995
         $returnEntry = new $className($response->getBody());
996 996
         $returnEntry->setHttpClient(self::getstaticHttpClient());
997 997
 
998  
-        $etag = $response->headers()->get('ETag');
  998
+        $etag = $response->getHeaders()->get('ETag');
999 999
         if ($etag instanceof Etag) {
1000 1000
             $returnEntry->setEtag($etag);
1001 1001
         }
4  library/Zend/GData/YouTube.php
@@ -178,11 +178,11 @@ public function setHttpClient(Http\Client $client = null,
178 178
         }
179 179
 
180 180
         if ($clientId != null) {
181  
-            $client->getRequest()->headers()->addHeaderLine('X-GData-Client', $clientId);
  181
+            $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Client', $clientId);
182 182
         }
183 183
 
184 184
         if ($developerKey != null) {
185  
-            $client->getRequest()->headers()->addHeaderLine('X-GData-Key', 'key='. $developerKey);
  185
+            $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Key', 'key='. $developerKey);
186 186
         }
187 187
 
188 188
         return parent::setHttpClient($client, $applicationId);
42  library/Zend/Http/Client.php
@@ -334,7 +334,7 @@ public function setUri($uri)
334 334
      */
335 335
     public function getUri()
336 336
     {
337  
-        return $this->getRequest()->uri();
  337
+        return $this->getRequest()->getUri();
338 338
     }
339 339
 
340 340
     /**
@@ -415,7 +415,7 @@ public function setRawBody($body)
415 415
      */
416 416
     public function setParameterPost(array $post)
417 417
     {
418  
-        $this->getRequest()->post()->fromArray($post);
  418
+        $this->getRequest()->getPost()->fromArray($post);
419 419
         return $this;
420 420
     }
421 421
 
@@ -427,7 +427,7 @@ public function setParameterPost(array $post)
427 427
      */
428 428
     public function setParameterGet(array $query)
429 429
     {
430  
-        $this->getRequest()->query()->fromArray($query);
  430
+        $this->getRequest()->getQuery()->fromArray($query);
431 431
         return $this;
432 432
     }
433 433
 
@@ -545,7 +545,7 @@ public function setHeaders($headers)
545 545
      */
546 546
     public function hasHeader($name)
547 547
     {
548  
-        $headers = $this->getRequest()->headers();
  548
+        $headers = $this->getRequest()->getHeaders();
549 549
 
550 550
         if ($headers instanceof Headers) {
551 551
             return $headers->has($name);
@@ -562,7 +562,7 @@ public function hasHeader($name)
562 562
      */
563 563
     public function getHeader($name)
564 564
     {
565  
-        $headers = $this->getRequest()->headers();
  565
+        $headers = $this->getRequest()->getHeaders();
566 566
 
567 567
         if ($headers instanceof Headers) {
568 568
             if ($headers->get($name)) {
@@ -766,7 +766,7 @@ public function send(Request $request = null)
766 766
             $uri = $this->getUri();
767 767
 
768 768
             // query
769  
-            $query = $this->getRequest()->query();
  769
+            $query = $this->getRequest()->getQuery();
770 770
 
771 771
             if (!empty($query)) {
772 772
                 $queryArray = $query->toArray();
@@ -855,17 +855,17 @@ public function send(Request $request = null)
855 855
             }
856 856
 
857 857
             // Get the cookies from response (if any)
858  
-            $setCookie = $response->cookie();
  858
+            $setCookie = $response->getCookie();
859 859
             if (!empty($setCookie)) {
860 860
                 $this->addCookie($setCookie);
861 861
             }
862 862
 
863 863
             // If we got redirected, look for the Location header
864  
-            if ($response->isRedirect() && ($response->headers()->has('Location'))) {
  864
+            if ($response->isRedirect() && ($response->getHeaders()->has('Location'))) {
865 865
 
866 866
                 // Avoid problems with buggy servers that add whitespace at the
867 867
                 // end of some headers
868  
-                $location = trim($response->headers()->get('Location')->getFieldValue());
  868
+                $location = trim($response->getHeaders()->get('Location')->getFieldValue());
869 869
 
870 870
                 // Check whether we send the exact same request again, or drop the parameters
871 871
                 // and send a GET request
@@ -946,7 +946,7 @@ public function setFileUpload($filename, $formname, $data = null, $ctype = null)
946 946
             }
947 947
         }
948 948
 
949  
-        $this->getRequest()->file()->set($filename, array(
  949
+        $this->getRequest()->getFile()->set($filename, array(
950 950
             'formname' => $formname,
951 951
             'filename' => basename($filename),
952 952
             'ctype' => $ctype,
@@ -964,9 +964,9 @@ public function setFileUpload($filename, $formname, $data = null, $ctype = null)
964 964
      */
965 965
     public function removeFileUpload($filename)
966 966
     {
967  
-        $file = $this->getRequest()->file()->get($filename);
  967
+        $file = $this->getRequest()->getFile()->get($filename);
968 968
         if (!empty($file)) {
969  
-            $this->getRequest()->file()->set($filename, null);
  969
+            $this->getRequest()->getFile()->set($filename, null);
970 970
             return true;
971 971
         }
972 972
         return false;
@@ -1026,7 +1026,7 @@ protected function prepareHeaders($body, $uri)
1026 1026
         }
1027 1027
 
1028 1028
         // Set the connection header
1029  
-        if (!$this->getRequest()->headers()->has('Connection')) {
  1029
+        if (!$this->getRequest()->getHeaders()->has('Connection')) {
1030 1030
             if (!$this->config['keepalive']) {
1031 1031
                 $headers['Connection'] = 'close';
1032 1032
             }
@@ -1044,7 +1044,7 @@ protected function prepareHeaders($body, $uri)
1044 1044
 
1045 1045
 
1046 1046
         // Set the user agent header
1047  
-        if (!$this->getRequest()->headers()->has('User-Agent') && isset($this->config['useragent'])) {
  1047
+        if (!$this->getRequest()->getHeaders()->has('User-Agent') && isset($this->config['useragent'])) {
1048 1048
             $headers['User-Agent'] = $this->config['useragent'];
1049 1049
         }
1050 1050
 
@@ -1078,7 +1078,7 @@ protected function prepareHeaders($body, $uri)
1078 1078
         }
1079 1079
 
1080 1080
         // Merge the headers of the request (if any)
1081  
-        $requestHeaders = $this->getRequest()->headers()->toArray();
  1081
+        $requestHeaders = $this->getRequest()->getHeaders()->toArray();
1082 1082
         foreach ($requestHeaders as $key => $value) {
1083 1083
             $headers[$key] = $value;
1084 1084
         }
@@ -1107,8 +1107,8 @@ protected function prepareBody()
1107 1107
         $body = '';
1108 1108
         $totalFiles = 0;
1109 1109
 
1110  
-        if (!$this->getRequest()->headers()->has('Content-Type')) {
1111  
-            $totalFiles = count($this->getRequest()->file()->toArray());
  1110
+        if (!$this->getRequest()->getHeaders()->has('Content-Type')) {
  1111
+            $totalFiles = count($this->getRequest()->getFile()->toArray());
1112 1112
             // If we have files to upload, force encType to multipart/form-data
1113 1113
             if ($totalFiles > 0) {
1114 1114
                 $this->setEncType(self::ENC_FORMDATA);
@@ -1118,26 +1118,26 @@ protected function prepareBody()
1118 1118
         }
1119 1119
 
1120 1120
         // If we have POST parameters or files, encode and add them to the body
1121  
-        if (count($this->getRequest()->post()->toArray()) > 0 || $totalFiles > 0) {
  1121
+        if (count($this->getRequest()->getPost()->toArray()) > 0 || $totalFiles > 0) {
1122 1122
             if (stripos($this->getEncType(), self::ENC_FORMDATA) === 0) {
1123 1123
                 $boundary = '---ZENDHTTPCLIENT-' . md5(microtime());
1124 1124
                 $this->setEncType(self::ENC_FORMDATA, $boundary);
1125 1125
 
1126 1126
                 // Get POST parameters and encode them
1127  
-                $params = self::flattenParametersArray($this->getRequest()->post()->toArray());
  1127
+                $params = self::flattenParametersArray($this->getRequest()->getPost()->toArray());
1128 1128
                 foreach ($params as $pp) {
1129 1129
                     $body .= $this->encodeFormData($boundary, $pp[0], $pp[1]);
1130 1130
                 }
1131 1131
 
1132 1132
                 // Encode files
1133  
-                foreach ($this->getRequest()->file()->toArray() as $key => $file) {
  1133
+                foreach ($this->getRequest()->getFile()->toArray() as $key => $file) {
1134 1134
                     $fhead = array('Content-Type' => $file['ctype']);
1135 1135
                     $body .= $this->encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
1136 1136
                 }
1137 1137
                 $body .= "--{$boundary}--\r\n";
1138 1138
             } elseif (stripos($this->getEncType(), self::ENC_URLENCODED) === 0) {
1139 1139
                 // Encode body as application/x-www-form-urlencoded
1140  
-                $body = http_build_query($this->getRequest()->post()->toArray());
  1140
+                $body = http_build_query($this->getRequest()->getPost()->toArray());
1141 1141
             } else {
1142 1142
                 throw new Client\Exception\RuntimeException("Cannot handle content type '{$this->encType}' automatically");
1143 1143
             }
4  library/Zend/Http/Client/Adapter/Proxy.php
@@ -81,7 +81,7 @@ public function connect($host, $port = 80, $secure = false)
81 81
         if (! $this->config['proxy_host']) {
82 82
             return parent::connect($host, $port, $secure);
83 83
         }
84  
-        
  84
+
85 85
         /* Url might require stream context even if proxy connection doesn't */
86 86
         if ($secure) {
87 87
             $this->config['sslusecontext'] = true;
@@ -172,7 +172,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
172 172
                 throw new AdapterException\RuntimeException('Error writing request to server');
173 173
             }
174 174
         }
175  
-        
  175
+
176 176
         return $request;
177 177
     }
178 178
 
36  library/Zend/Http/Client/Adapter/Socket.php
@@ -55,11 +55,11 @@ class Socket implements HttpAdapter, StreamInterface
55 55
 
56 56
     /**
57 57
      * Stream for storing output
58  
-     * 
  58
+     *
59 59
      * @var resource
60 60
      */
61 61
     protected $out_stream = null;
62  
-    
  62
+
63 63
     /**
64 64
      * Parameters array
65 65
      *
@@ -237,7 +237,7 @@ public function connect($host, $port = 80, $secure = false)
237 237
         }
238 238
     }
239 239
 
240  
-    
  240
+
241 241
     /**
242 242
      * Send request to the remote server
243 243
      *
@@ -279,12 +279,12 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
279 279
             // Add the request body
280 280
             $request .= "\r\n" . $body;
281 281
         }
282  
-        
  282
+
283 283
         // Send the request
284 284
         if (! @fwrite($this->socket, $request)) {
285 285
             throw new AdapterException\RuntimeException('Error writing request to server');
286 286
         }
287  
-        
  287
+
288 288
         if (is_resource($body)) {
289 289
             if (stream_copy_to_stream($body, $this->socket) == 0) {
290 290
                 throw new AdapterException\RuntimeException('Error writing request to server');
@@ -312,18 +312,18 @@ public function read()
312 312
                 if (rtrim($line) === '') break;
313 313
             }
314 314
         }
315  
-        
  315
+
316 316
         $this->_checkSocketReadTimeout();
317 317
 
318 318
         $responseObj= Response::fromString($response);
319  
-        
  319
+
320 320
         $statusCode = $responseObj->getStatusCode();
321 321
 
322 322
         // Handle 100 and 101 responses internally by restarting the read again
323 323
         if ($statusCode == 100 || $statusCode == 101) return $this->read();
324 324
 
325 325
         // Check headers to see what kind of connection / transfer encoding we have
326  
-        $headers = $responseObj->headers();
  326
+        $headers = $responseObj->getHeaders();
327 327
 
328 328
         /**
329 329
          * Responses to HEAD requests and 204 or 304 responses are not expected
@@ -344,7 +344,7 @@ public function read()
344 344
         $transfer_encoding = $headers->get('transfer-encoding');
345 345
         $content_length = $headers->get('content-length');
346 346
         if ($transfer_encoding !== false) {
347  
-            
  347
+
348 348
             if (strtolower($transfer_encoding->getFieldValue()) == 'chunked') {
349 349
 
350 350
                 do {
@@ -374,7 +374,7 @@ public function read()
374 374
                         if ($this->out_stream) {
375 375
                             if (stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
376 376
                               $this->_checkSocketReadTimeout();
377  
-                              break;   
  377
+                              break;
378 378
                              }
379 379
                         } else {
380 380
                             $line = @fread($this->socket, $read_to - $current_pos);
@@ -398,7 +398,7 @@ public function read()
398 398
                 throw new AdapterException\RuntimeException('Cannot handle "' .
399 399
                     $transfer_encoding->getFieldValue() . '" transfer encoding');
400 400
             }
401  
-            
  401
+
402 402
             // We automatically decode chunked-messages when writing to a stream
403 403
             // this means we have to disallow the Zend_Http_Response to do it again
404 404
             if ($this->out_stream) {
@@ -413,7 +413,7 @@ public function read()
413 413
                 $content_length = $content_length[count($content_length) - 1];
414 414
             }
415 415
             $contentLength = $content_length->getFieldValue();
416  
-            
  416
+
417 417
             $current_pos = ftell($this->socket);
418 418
             $chunk = '';
419 419
 
@@ -424,7 +424,7 @@ public function read()
424 424
                  if ($this->out_stream) {
425 425
                      if (@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
426 426
                           $this->_checkSocketReadTimeout();
427  
-                          break;   
  427
+                          break;
428 428
                      }
429 429
                  } else {
430 430
                     $chunk = @fread($this->socket, $read_to - $current_pos);
@@ -447,7 +447,7 @@ public function read()
447 447
                 if ($this->out_stream) {
448 448
                     if (@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
449 449
                           $this->_checkSocketReadTimeout();
450  
-                          break;   
  450
+                          break;
451 451
                      }
452 452
                 } else {
453 453
                     $buff = @fread($this->socket, 8192);
@@ -504,19 +504,19 @@ protected function _checkSocketReadTimeout()
504 504
             }
505 505
         }
506 506
     }
507  
-    
  507
+
508 508
     /**
509 509
      * Set output stream for the response
510  
-     * 
  510
+     *
511 511
      * @param resource $stream
512 512
      * @return \Zend\Http\Client\Adapter\Socket
513 513
      */
514  
-    public function setOutputStream($stream) 
  514
+    public function setOutputStream($stream)
515 515
     {
516 516
         $this->out_stream = $stream;
517 517
         return $this;
518 518
     }
519  
-    
  519
+
520 520
     /**
521 521
      * Destructor: make sure the socket is disconnected
522 522
      *
6  library/Zend/Http/Client/Adapter/StreamInterface.php
@@ -36,11 +36,11 @@
36 36
 {
37 37
     /**
38 38
      * Set output stream
39  
-     * 
  39
+     *
40 40
      * This function sets output stream where the result will be stored.
41  
-     * 
  41
+     *
42 42
      * @param resource $stream Stream to write the output to
43  
-     * 
  43
+     *
44 44
      */
45 45
     function setOutputStream($stream);
46 46
 }
10  library/Zend/Http/Client/Cookies.php
@@ -31,7 +31,7 @@
31 31
  * be used along with Zend_Http_Client in order to manage cookies across HTTP requests and
32 32
  * responses.
33 33
  *
34  
- * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added 
  34
+ * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
35 35
  * automatically from a request or manually. Then, the Cookies class can find and return the
36 36
  * cookies needed for a specific HTTP request.
37 37
  *
@@ -49,7 +49,7 @@
49 49
  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
50 50
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
51 51
  */
52  
-class Cookies //implements ParametersInterface
  52
+class Cookies
53 53
 {
54 54
     /**
55 55
      * Return cookie(s) as a Zend\Http\Header\Cookie object
@@ -96,7 +96,7 @@ class Cookies //implements ParametersInterface
96 96
     protected $_rawCookies = array();
97 97
 
98 98
     /**
99  
-     * Construct 
  99
+     * Construct
100 100
      *
101 101
      */
102 102
     public function __construct()
@@ -139,7 +139,7 @@ public function addCookie($cookie, $ref_uri = null)
139 139
      */
140 140
     public function addCookiesFromResponse(Response $response, $ref_uri)
141 141
     {
142  
-        $cookie_hdrs = $response->headers()->get('Set-Cookie');
  142
+        $cookie_hdrs = $response->getHeaders()->get('Set-Cookie');
143 143
 
144 144
         if (is_array($cookie_hdrs)) {
145 145
             foreach ($cookie_hdrs as $cookie) {
@@ -375,7 +375,7 @@ public function getIterator()
375 375
     }
376 376
 
377 377
     /**
378  
-     * Tells if the array of cookies is empty 
  378
+     * Tells if the array of cookies is empty
379 379
      *
380 380
      * @return bool
381 381
      */
34  library/Zend/Http/ClientStatic.php
@@ -32,7 +32,7 @@
32 32
  */
33 33
 class ClientStatic
34 34
 {
35  
-    
  35
+
36 36
     protected static $client;
37 37
 
38 38
     /**
@@ -47,7 +47,7 @@ protected static function getStaticClient()
47 47
         }
48 48
         return self::$client;
49 49
     }
50  
-    
  50
+
51 51
     /**
52 52
      * HTTP GET METHOD (static)
53 53
      *
@@ -61,23 +61,23 @@ public static function get($url, $query=array(), $headers=array(), $body=null)
61 61
         if (empty($url)) {
62 62
             return false;
63 63
         }
64  
-        
  64
+
65 65
         $request= new Request();
66 66
         $request->setUri($url);
67 67
         $request->setMethod(Request::METHOD_GET);
68  
-        
  68
+
69 69
         if (!empty($query) && is_array($query)) {
70  
-            $request->query()->fromArray($query);
  70
+            $request->getQuery()->fromArray($query);
71 71
         }
72  
-        
  72
+
73 73
         if (!empty($headers) && is_array($headers)) {
74  
-            $request->headers()->addHeaders($headers);
  74
+            $request->getHeaders()->addHeaders($headers);
75 75
         }
76  
-        
  76
+
77 77
         if (!empty($body)) {
78 78
             $request->setBody($body);
79 79
         }
80  
-        
  80
+
81 81
         return self::getStaticClient()->send($request);
82 82
     }
83 83
     /**
@@ -93,29 +93,29 @@ public static function post($url, $params, $headers=array(), $body=null)
93 93
         if (empty($url)) {
94 94
             return false;
95 95
         }
96  
-        
  96
+
97 97
         $request= new Request();
98 98
         $request->setUri($url);
99 99
         $request->setMethod(Request::METHOD_POST);
100  
-        
  100
+
101 101
         if (!empty($params) && is_array($params)) {
102  
-            $request->post()->fromArray($params);
  102
+            $request->getPost()->fromArray($params);
103 103
         } else {
104 104
             throw new Exception\InvalidArgumentException('The array of post parameters is empty');
105 105
         }
106  
-        
  106
+
107 107
         if (!isset($headers['Content-Type'])) {
108 108
             $headers['Content-Type']= Client::ENC_URLENCODED;
109 109
         }
110  
-        
  110
+
111 111
         if (!empty($headers) && is_array($headers)) {
112  
-            $request->headers()->addHeaders($headers);
  112
+            $request->getHeaders()->addHeaders($headers);
113 113
         }
114  
-        
  114
+
115 115
         if (!empty($body)) {
116 116
             $request->setContent($body);
117 117
         }
118  
-        
  118
+
119 119
         return self::getStaticClient()->send($request);
120 120
     }
121 121
 }
53  library/Zend/Http/Cookies.php
@@ -11,7 +11,7 @@
11 11
  * be used along with Zend_Http_Client in order to manage cookies across HTTP requests and
12 12
  * responses.
13 13
  *
14  
- * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added 
  14
+ * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
15 15
  * automatically from a request or manually. Then, the Cookies class can find and return the
16 16
  * cookies needed for a specific HTTP request.
17 17
  *
@@ -31,48 +31,6 @@
31 31
  */
32 32
 class Cookies extends Headers
33 33
 {
34  
-
35  
-
36  
-
37  
-
38  
-//    /**
39  
-//     * Return cookie(s) as a Zend\Http\Header\Cookie object
40  
-//     *
41  
-//     */
42  
-//    const COOKIE_OBJECT = 0;
43  
-//
44  
-//    /**
45  
-//     * Return cookie(s) as a string (suitable for sending in an HTTP request)
46  
-//     *
47  
-//     */
48  
-//    const COOKIE_STRING_ARRAY = 1;
49  
-//
50  
-//    /**
51  
-//     * Return all cookies as one long string (suitable for sending in an HTTP request)
52  
-//     *
53  
-//     */
54  
-//    const COOKIE_STRING_CONCAT = 2;
55  
-//
56  
-//    /**
57  
-//     * Array storing cookies
58  
-//     *
59  
-//     * Cookies are stored according to domain and path:
60  
-//     * $cookies
61  
-//     *  + www.mydomain.com
62  
-//     *    + /
63  
-//     *      - cookie1
64  
-//     *      - cookie2
65  
-//     *    + /somepath
66  
-//     *      - othercookie
67  
-//     *  + www.otherdomain.net
68  
-//     *    + /
69  
-//     *      - alsocookie
70  
-//     *
71  
-//     * @var array
72  
-//     */
73  
-
74  
-
75  
-
76 34
     /**
77 35
      * @var Headers
78 36
      */
@@ -92,13 +50,6 @@ public static function fromString($string)
92 50
         );
93 51
     }
94 52
 
95  
-//    /**
96  
-//     * The Zend\Http\Header\Cookie array
97  
-//     *
98  
-//     * @var array
99  
-//     */
100  
-//    protected $_rawCookies = array();
101  
-
102 53
     public function __construct(Headers $headers, $context = self::CONTEXT_REQUEST)
103 54
     {
104 55
         $this->headers = $headers;
@@ -358,7 +309,7 @@ public static function fromResponse(Response $response, $ref_uri)
358 309
     }
359 310
 
360 311
     /**
361  
-     * Tells if the array of cookies is empty 
  312
+     * Tells if the array of cookies is empty
362 313
      *
363 314
      * @return bool
364 315
      */
2  library/Zend/Http/Exception/RuntimeException.php
@@ -3,7 +3,7 @@
3 3
 namespace Zend\Http\Exception;
4 4
 
5 5
 class RuntimeException
6  
-    extends \RuntimeException 
  6
+    extends \RuntimeException
7 7
     implements ExceptionInterface
8 8
 {
9 9
 }
8  library/Zend/Http/Headers.php
@@ -195,7 +195,7 @@ public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)
195 195
 
196 196
     /**
197 197
      * Add a Header to this container, for raw values @see addHeaderLine() and addHeaders()
198  
-     * 
  198
+     *
199 199
      * @param  Header\HeaderInterface $header
200 200
      * @return Headers
201 201
      */
@@ -229,7 +229,7 @@ public function removeHeader(Header\HeaderInterface $header)
229 229
      * Clear all headers
230 230
      *
231 231
      * Removes all headers from queue
232  
-     * 
  232
+     *
233 233
      * @return Headers
234 234
      */
235 235
     public function clearHeaders()
@@ -240,7 +240,7 @@ public function clearHeaders()
240 240
 
241 241
     /**
242 242
      * Get all headers of a certain name/type
243  
-     * 
  243
+     *
244 244
      * @param  string $name
245 245
      * @return bool|Header\HeaderInterface|ArrayIterator
246 246
      */
@@ -279,7 +279,7 @@ public function get($name)
279 279
 
280 280
     /**
281 281
      * Test for existence of a type of header
282  
-     * 
  282
+     *
283 283
      * @param  string $name
284 284
      * @return bool
285 285
      */
80  library/Zend/Http/PhpEnvironment/Request.php
@@ -28,21 +28,21 @@ class Request extends HttpRequest
28 28
 {
29 29
     /**
30 30
      * Base URL of the application.
31  
-     * 
  31
+     *
32 32
      * @var string
33 33
      */
34 34
     protected $baseUrl;
35  
-    
  35
+
36 36
     /**
37 37
      * Base Path of the application.
38 38
      *
39 39
      * @var string
40 40
      */
41 41
     protected $basePath;
42  
-    
  42
+
43 43
     /**
44 44
      * Actual request URI, independent of the platform.
45  
-     * 
  45
+     *
46 46
      * @var string
47 47
      */
48 48
     protected $requestUri;
@@ -81,7 +81,7 @@ public function __construct()
81 81
      */
82 82
     public function setCookies($cookie)
83 83
     {
84  
-        $this->headers()->addHeader(new Cookie((array) $cookie));
  84
+        $this->getHeaders()->addHeader(new Cookie((array) $cookie));
85 85
         return $this;
86 86
     }
87 87
 
@@ -109,7 +109,7 @@ public function getRequestUri()
109 109
         }
110 110
         return $this->requestUri;
111 111
     }
112  
-    
  112
+
113 113
     /**
114 114
      * Set the base URL.
115 115
      *
@@ -134,10 +134,10 @@ public function getBaseUrl()
134 134
         }
135 135
         return $this->baseUrl;
136 136
     }
137  
-    
  137
+
138 138
     /**
139 139
      * Set the base path.
140  
-     * 
  140
+     *
141 141
      * @param  string $basePath
142 142
      * @return self
143 143
      */
@@ -157,7 +157,7 @@ public function getBasePath()
157 157
         if ($this->basePath === null) {
158 158
             $this->setBasePath($this->detectBasePath());
159 159
         }
160  
-        
  160
+
161 161
         return $this->basePath;
162 162
     }
163 163
 
@@ -182,20 +182,20 @@ public function setServer(ParametersInterface $server)
182 182
             }
183 183
         }
184 184
 
185  
-        $this->headers()->addHeaders($this->serverToHeaders($this->serverParams));
  185
+        $this->getHeaders()->addHeaders($this->serverToHeaders($this->serverParams));
186 186
 
187 187
         if (isset($this->serverParams['REQUEST_METHOD'])) {
188 188
             $this->setMethod($this->serverParams['REQUEST_METHOD']);
189 189
         }
190 190
 
191  
-        if (isset($this->serverParams['SERVER_PROTOCOL']) 
  191
+        if (isset($this->serverParams['SERVER_PROTOCOL'])
192 192
             && strpos($this->serverParams['SERVER_PROTOCOL'], '1.0') !== false) {
193 193
             $this->setVersion('1.0');
194 194
         }
195 195
 
196 196
         $this->setUri($uri = new HttpUri());
197 197
 
198  
-        if (isset($this->serverParams['HTTPS']) && $this->serverParams['HTTPS'] === 'on') { 
  198
+        if (isset($this->serverParams['HTTPS']) && $this->serverParams['HTTPS'] === 'on') {
199 199
             $uri->setScheme('https');
200 200
         } else {
201 201
             $uri->setScheme('http');
@@ -205,13 +205,13 @@ public function setServer(ParametersInterface $server)
205 205
             $uri->setQuery($this->serverParams['QUERY_STRING']);
206 206
         }
207 207
 
208  
-        if ($this->headers()->get('host')) {
  208
+        if ($this->getHeaders()->get('host')) {
209 209
             //TODO handle IPv6 with port
210  
-            if (preg_match('|^([^:]+):([^:]+)$|', $this->headers()->get('host')->getFieldValue(), $match)) {
  210
+            if (preg_match('|^([^:]+):([^:]+)$|', $this->getHeaders()->get('host')->getFieldValue(), $match)) {
211 211
                 $uri->setHost($match[1]);
212 212
                 $uri->setPort($match[2]);
213 213
             } else {
214  
-                $uri->setHost($this->headers()->get('host')->getFieldValue());
  214
+                $uri->setHost($this->getHeaders()->get('host')->getFieldValue());
215 215
             }
216 216
         } elseif (isset($this->serverParams['SERVER_NAME'])) {
217 217
             $uri->setHost($this->serverParams['SERVER_NAME']);
@@ -262,7 +262,7 @@ protected function serverToHeaders($server)
262 262
      *
263 263
      * Looks at a variety of criteria in order to attempt to autodetect a base
264 264
      * URI, including rewrite URIs, proxy URIs, etc.
265  
-     * 
  265
+     *
266 266
      * @return string
267 267
      */
268 268
     protected function detectRequestUri()
@@ -270,43 +270,43 @@ protected function detectRequestUri()
270 270
         $requestUri = null;
271 271
 
272 272
         // Check this first so IIS will catch.
273  
-        $httpXRewriteUrl = $this->server()->get('HTTP_X_REWRITE_URL');
  273
+        $httpXRewriteUrl = $this->getServer()->get('HTTP_X_REWRITE_URL');
274 274
         if ($httpXRewriteUrl !== null) {
275 275
             $requestUri = $httpXRewriteUrl;
276 276
         }
277  
-        
  277
+
278 278
         // Check for IIS 7.0 or later with ISAPI_Rewrite
279  
-        $httpXOriginalUrl = $this->server()->get('HTTP_X_ORIGINAL_URL');
  279
+        $httpXOriginalUrl = $this->getServer()->get('HTTP_X_ORIGINAL_URL');
280 280
         if ($httpXOriginalUrl !== null) {
281 281
             $requestUri = $httpXOriginalUrl;
282 282
         }
283  
-       
  283
+
284 284
         // IIS7 with URL Rewrite: make sure we get the unencoded url
285 285
         // (double slash problem).
286  
-        $iisUrlRewritten = $this->server()->get('IIS_WasUrlRewritten');
287  
-        $unencodedUrl    = $this->server()->get('UNENCODED_URL', '');
  286
+        $iisUrlRewritten = $this->getServer()->get('IIS_WasUrlRewritten');
  287
+        $unencodedUrl    = $this->getServer()->get('UNENCODED_URL', '');
288 288
         if ('1' == $iisUrlRewritten && '' !== $unencodedUrl) {
289 289
             return $unencodedUrl;
290  
-        } 
291  
-        
  290
+        }
  291
+
292 292
         // HTTP proxy requests setup request URI with scheme and host
293 293
         // [and port] + the URL path, only use URL path.
294 294
         if (!$httpXRewriteUrl) {
295  
-            $requestUri = $this->server()->get('REQUEST_URI');
  295
+            $requestUri = $this->getServer()->get('REQUEST_URI');
296 296
         }
297 297
         if ($requestUri !== null) {
298  
-            $schemeAndHttpHost = $this->uri()->getScheme() . '://' . $this->uri()->getHost();
299  
-            
  298
+            $schemeAndHttpHost = $this->getUri()->getScheme() . '://' . $this->getUri()->getHost();
  299
+
300 300
             if (strpos($requestUri, $schemeAndHttpHost) === 0) {
301 301
                 $requestUri = substr($requestUri, strlen($schemeAndHttpHost));
302 302
             }
303 303
             return $requestUri;
304  
-        } 
305  
-        
  304
+        }
  305
+
306 306
         // IIS 5.0, PHP as CGI.
307  
-        $origPathInfo = $this->server()->get('ORIG_PATH_INFO');
  307
+        $origPathInfo = $this->getServer()->get('ORIG_PATH_INFO');
308 308
         if ($origPathInfo !== null) {
309  
-            $queryString = $this->server()->get('QUERY_STRING', '');
  309
+            $queryString = $this->getServer()->get('QUERY_STRING', '');
310 310
             if ($queryString !== '') {
311 311
                 $origPathInfo .= '?' . $queryString;
312 312
             }
@@ -323,16 +323,16 @@ protected function detectRequestUri()
323 323
      * (i.e., anything additional to the document root).
324 324
      *
325 325
      * The base URL includes the schema, host, and port, in addition to the path.
326  
-     * 
  326
+     *
327 327
      * @return string
328 328
      */
329 329
     protected function detectBaseUrl()
330 330
     {
331 331
         $baseUrl        = '';
332  
-        $filename       = $this->server()->get('SCRIPT_FILENAME', '');
333  
-        $scriptName     = $this->server()->get('SCRIPT_NAME');
334  
-        $phpSelf        = $this->server()->get('PHP_SELF');
335  
-        $origScriptName = $this->server()->get('ORIG_SCRIPT_NAME');
  332
+        $filename       = $this->getServer()->get('SCRIPT_FILENAME', '');
  333
+        $scriptName     = $this->getServer()->get('SCRIPT_NAME');
  334
+        $phpSelf        = $this->getServer()->get('PHP_SELF');
  335
+        $origScriptName = $this->getServer()->get('ORIG_SCRIPT_NAME');
336 336
 
337 337
         if ($scriptName !== null && basename($scriptName) === $filename) {
338 338
             $baseUrl = $scriptName;
@@ -393,19 +393,19 @@ protected function detectBaseUrl()
393 393
      * Autodetect the base path of the request
394 394
      *
395 395
      * Uses several criteria to determine the base path of the request.
396  
-     * 
  396
+     *
397 397
      * @return string
398 398
      */
399 399
     protected function detectBasePath()
400 400
     {
401  
-        $filename = basename($this->server()->get('SCRIPT_FILENAME', ''));
  401
+        $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
402 402
         $baseUrl  = $this->getBaseUrl();
403 403
 
404 404
         // Empty base url detected
405 405
         if ($baseUrl === '') {
406 406
             return '';
407  
-        } 
408  
-        
  407
+        }
  408
+
409 409
         // basename() matches the script filename; return the directory
410 410
         if (basename($baseUrl) === $filename) {
411 411
             return str_replace('\\', '/', dirname($baseUrl));
14  library/Zend/Http/PhpEnvironment/Response.php
@@ -16,17 +16,17 @@ class Response extends HttpResponse