Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 16 commits into from

2 participants

@juriansluiman

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.

@juriansluiman

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

@weierophinney weierophinney merged commit 7a5b6c7 into zendframework:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 30, 2012
  1. @juriansluiman

    Rename all accessors to a get*() pattern

    juriansluiman authored
    The methods uri(), query(), post(), server(), env(), file() and cookie()
    change to a get*() pattern like getQuery().
  2. @juriansluiman

    Code cleanup

    juriansluiman authored
    1. Remove trailing white spaces
    2. Remove commented code
  3. @juriansluiman

    Update Zend\Http to use new accessors

    juriansluiman authored
    All query() replaced by getQuery() etc
  4. @juriansluiman
  5. @juriansluiman
  6. @juriansluiman
  7. @juriansluiman
  8. @juriansluiman
  9. @juriansluiman
  10. @juriansluiman
  11. @juriansluiman
  12. @juriansluiman
  13. @juriansluiman
  14. @juriansluiman
  15. @juriansluiman
  16. @juriansluiman
This page is out of date. Refresh to see the latest.
Showing with 393 additions and 441 deletions.
  1. +5 −5 library/Zend/Authentication/Adapter/Http.php
  2. +5 −5 library/Zend/GData/App.php
  3. +2 −2 library/Zend/GData/YouTube.php
  4. +21 −21 library/Zend/Http/Client.php
  5. +2 −2 library/Zend/Http/Client/Adapter/Proxy.php
  6. +18 −18 library/Zend/Http/Client/Adapter/Socket.php
  7. +3 −3 library/Zend/Http/Client/Adapter/StreamInterface.php
  8. +5 −5 library/Zend/Http/Client/Cookies.php
  9. +17 −17 library/Zend/Http/ClientStatic.php
  10. +2 −51 library/Zend/Http/Cookies.php
  11. +1 −1  library/Zend/Http/Exception/RuntimeException.php
  12. +4 −4 library/Zend/Http/Headers.php
  13. +40 −40 library/Zend/Http/PhpEnvironment/Request.php
  14. +7 −7 library/Zend/Http/PhpEnvironment/Response.php
  15. +14 −14 library/Zend/Http/Request.php
  16. +6 −6 library/Zend/Http/Response.php
  17. +22 −22 library/Zend/Http/Response/Stream.php
  18. +2 −2 library/Zend/Json/Server/Client.php
  19. +4 −4 library/Zend/Mvc/Controller/AbstractRestfulController.php
  20. +2 −2 library/Zend/Mvc/Controller/Plugin/Params.php
  21. +2 −2 library/Zend/Mvc/Controller/Plugin/Redirect.php
  22. +2 −2 library/Zend/Mvc/Router/Http/Hostname.php
  23. +2 −2 library/Zend/Mvc/Router/Http/Literal.php
  24. +2 −2 library/Zend/Mvc/Router/Http/Part.php
  25. +2 −2 library/Zend/Mvc/Router/Http/Query.php
  26. +2 −2 library/Zend/Mvc/Router/Http/Regex.php
  27. +2 −2 library/Zend/Mvc/Router/Http/Scheme.php
  28. +2 −2 library/Zend/Mvc/Router/Http/Segment.php
  29. +2 −2 library/Zend/Mvc/Router/Http/TreeRouteStack.php
  30. +2 −2 library/Zend/Mvc/Router/Http/Wildcard.php
  31. +7 −7 library/Zend/OAuth/Client.php
  32. +2 −2 library/Zend/OAuth/Http/RequestToken.php
  33. +1 −1  library/Zend/OAuth/OAuth.php
  34. +3 −2 library/Zend/OpenId/OpenId.php
  35. +6 −6 library/Zend/Rest/Client/RestClient.php
  36. +19 −19 library/Zend/Service/Rackspace/Rackspace.php
  37. +3 −3 library/Zend/View/Helper/Json.php
  38. +2 −2 library/Zend/View/Strategy/FeedStrategy.php
  39. +3 −3 library/Zend/View/Strategy/JsonStrategy.php
  40. +2 −2 library/Zend/XmlRpc/Client.php
  41. +2 −2 tests/Zend/Authentication/Adapter/Http/AuthTest.php
  42. +1 −1  tests/Zend/Authentication/Adapter/Http/ProxyTest.php
  43. +7 −7 tests/Zend/Http/ClientTest.php
  44. +2 −2 tests/Zend/Http/PhpEnvironment/RequestTest.php
  45. +19 −19 tests/Zend/Http/RequestTest.php
  46. +17 −17 tests/Zend/Http/Response/ResponseStreamTest.php
  47. +14 −14 tests/Zend/Http/ResponseTest.php
  48. +1 −1  tests/Zend/Json/Server/ClientTest.php
  49. +2 −2 tests/Zend/Mvc/Controller/Plugin/ParamsTest.php
  50. +2 −2 tests/Zend/Mvc/Controller/Plugin/RedirectTest.php
  51. +1 −1  tests/Zend/Mvc/Controller/RestfulControllerTest.php
  52. +15 −15 tests/Zend/OAuth/OAuthTest.php
  53. +6 −6 tests/Zend/OpenId/ConsumerTest.php
  54. +6 −6 tests/Zend/OpenId/OpenIdTest.php
  55. +31 −31 tests/Zend/OpenId/ProviderTest.php
  56. +1 −1  tests/Zend/View/Helper/JsonTest.php
  57. +6 −6 tests/Zend/View/Strategy/FeedStrategyTest.php
  58. +6 −6 tests/Zend/View/Strategy/JsonStrategyTest.php
  59. +3 −3 tests/Zend/View/Strategy/PhpRendererStrategyTest.php
  60. +1 −1  tests/Zend/XmlRpc/ClientTest.php
View
10 library/Zend/Authentication/Adapter/Http.php
@@ -348,7 +348,7 @@ public function authenticate()
$getHeader = 'Authorization';
}
- $headers = $this->_request->headers();
+ $headers = $this->_request->getHeaders();
if (!$headers->has($getHeader)) {
return $this->_challengeClient();
}
@@ -412,7 +412,7 @@ protected function _challengeClient()
$this->_response->setStatusCode($statusCode);
// Send a challenge in each acceptable authentication scheme
- $headers = $this->_response->headers();
+ $headers = $this->_response->getHeaders();
if (in_array('basic', $this->_acceptSchemes)) {
$headers->addHeaderLine($headerName, $this->_basicHeader());
}
@@ -614,7 +614,7 @@ protected function _calcNonce()
// would be surprising if the user just logged in.
$timeout = ceil(time() / $this->_nonceTimeout) * $this->_nonceTimeout;
- $nonce = hash('md5', $timeout . ':' . $this->_request->server()->get('HTTP_USER_AGENT') . ':' . __CLASS__);
+ $nonce = hash('md5', $timeout . ':' . $this->_request->getServer()->get('HTTP_USER_AGENT') . ':' . __CLASS__);
return $nonce;
}
@@ -688,7 +688,7 @@ protected function _parseDigestAuth($header)
// Section 3.2.2.5 in RFC 2617 says the authenticating server must
// verify that the URI field in the Authorization header is for the
// same resource requested in the Request Line.
- $rUri = $this->_request->uri();
+ $rUri = $this->_request->getUri();
$cUri = UriFactory::factory($temp[1]);
// Make sure the path portion of both URIs is the same
@@ -744,7 +744,7 @@ protected function _parseDigestAuth($header)
if (!$ret || empty($temp[1])) {
// Big surprise: IE isn't RFC 2617-compliant.
- $headers = $this->_request->headers();
+ $headers = $this->_request->getHeaders();
if (!$headers->has('User-Agent')) {
return false;
}
View
10 library/Zend/GData/App.php
@@ -241,7 +241,7 @@ public function setHttpClient(Http\Client $client = null, $applicationId = 'MyCo
$userAgent = $applicationId . ' Zend_Framework_Gdata/' .
\Zend\Version::VERSION;
- $client->getRequest()->headers()->addHeaderLine('User-Agent', $userAgent);
+ $client->getRequest()->getHeaders()->addHeaderLine('User-Agent', $userAgent);
$client->setOptions(array(
'strictredirects' => true
)
@@ -750,7 +750,7 @@ public function importUrl($url, $className='Zend\GData\App\Feed',
return $feedContent;
}
- $header = $response->headers()->get('GData-Version');
+ $header = $response->getHeaders()->get('GData-Version');
$majorProtocolVersion = null;
$minorProtocolVersion = null;
if ($header instanceof Http\Header\HeaderInterface) {
@@ -769,7 +769,7 @@ public function importUrl($url, $className='Zend\GData\App\Feed',
if ($this->getHttpClient() != null) {
$feed->setHttpClient($this->getHttpClient());
}
- $etag = $response->headers()->get('ETag');
+ $etag = $response->getHeaders()->get('ETag');
if ($etag instanceof Etag) {
$feed->setEtag($etag);
}
@@ -956,7 +956,7 @@ public function insertEntry($data, $uri, $className='Zend\GData\App\Entry',
$returnEntry = new $className($response->getBody());
$returnEntry->setHttpClient(self::getstaticHttpClient());
- $etag = $response->headers()->get('ETag');
+ $etag = $response->getHeaders()->get('ETag');
if ($etag instanceof Etag) {
$returnEntry->setEtag($etag);
}
@@ -995,7 +995,7 @@ public function updateEntry($data, $uri = null, $className = null,
$returnEntry = new $className($response->getBody());
$returnEntry->setHttpClient(self::getstaticHttpClient());
- $etag = $response->headers()->get('ETag');
+ $etag = $response->getHeaders()->get('ETag');
if ($etag instanceof Etag) {
$returnEntry->setEtag($etag);
}
View
4 library/Zend/GData/YouTube.php
@@ -178,11 +178,11 @@ public function setHttpClient(Http\Client $client = null,
}
if ($clientId != null) {
- $client->getRequest()->headers()->addHeaderLine('X-GData-Client', $clientId);
+ $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Client', $clientId);
}
if ($developerKey != null) {
- $client->getRequest()->headers()->addHeaderLine('X-GData-Key', 'key='. $developerKey);
+ $client->getRequest()->getHeaders()->addHeaderLine('X-GData-Key', 'key='. $developerKey);
}
return parent::setHttpClient($client, $applicationId);
View
42 library/Zend/Http/Client.php
@@ -334,7 +334,7 @@ public function setUri($uri)
*/
public function getUri()
{
- return $this->getRequest()->uri();
+ return $this->getRequest()->getUri();
}
/**
@@ -415,7 +415,7 @@ public function setRawBody($body)
*/
public function setParameterPost(array $post)
{
- $this->getRequest()->post()->fromArray($post);
+ $this->getRequest()->getPost()->fromArray($post);
return $this;
}
@@ -427,7 +427,7 @@ public function setParameterPost(array $post)
*/
public function setParameterGet(array $query)
{
- $this->getRequest()->query()->fromArray($query);
+ $this->getRequest()->getQuery()->fromArray($query);
return $this;
}
@@ -545,7 +545,7 @@ public function setHeaders($headers)
*/
public function hasHeader($name)
{
- $headers = $this->getRequest()->headers();
+ $headers = $this->getRequest()->getHeaders();
if ($headers instanceof Headers) {
return $headers->has($name);
@@ -562,7 +562,7 @@ public function hasHeader($name)
*/
public function getHeader($name)
{
- $headers = $this->getRequest()->headers();
+ $headers = $this->getRequest()->getHeaders();
if ($headers instanceof Headers) {
if ($headers->get($name)) {
@@ -766,7 +766,7 @@ public function send(Request $request = null)
$uri = $this->getUri();
// query
- $query = $this->getRequest()->query();
+ $query = $this->getRequest()->getQuery();
if (!empty($query)) {
$queryArray = $query->toArray();
@@ -855,17 +855,17 @@ public function send(Request $request = null)
}
// Get the cookies from response (if any)
- $setCookie = $response->cookie();
+ $setCookie = $response->getCookie();
if (!empty($setCookie)) {
$this->addCookie($setCookie);
}
// If we got redirected, look for the Location header
- if ($response->isRedirect() && ($response->headers()->has('Location'))) {
+ if ($response->isRedirect() && ($response->getHeaders()->has('Location'))) {
// Avoid problems with buggy servers that add whitespace at the
// end of some headers
- $location = trim($response->headers()->get('Location')->getFieldValue());
+ $location = trim($response->getHeaders()->get('Location')->getFieldValue());
// Check whether we send the exact same request again, or drop the parameters
// and send a GET request
@@ -946,7 +946,7 @@ public function setFileUpload($filename, $formname, $data = null, $ctype = null)
}
}
- $this->getRequest()->file()->set($filename, array(
+ $this->getRequest()->getFile()->set($filename, array(
'formname' => $formname,
'filename' => basename($filename),
'ctype' => $ctype,
@@ -964,9 +964,9 @@ public function setFileUpload($filename, $formname, $data = null, $ctype = null)
*/
public function removeFileUpload($filename)
{
- $file = $this->getRequest()->file()->get($filename);
+ $file = $this->getRequest()->getFile()->get($filename);
if (!empty($file)) {
- $this->getRequest()->file()->set($filename, null);
+ $this->getRequest()->getFile()->set($filename, null);
return true;
}
return false;
@@ -1026,7 +1026,7 @@ protected function prepareHeaders($body, $uri)
}
// Set the connection header
- if (!$this->getRequest()->headers()->has('Connection')) {
+ if (!$this->getRequest()->getHeaders()->has('Connection')) {
if (!$this->config['keepalive']) {
$headers['Connection'] = 'close';
}
@@ -1044,7 +1044,7 @@ protected function prepareHeaders($body, $uri)
// Set the user agent header
- if (!$this->getRequest()->headers()->has('User-Agent') && isset($this->config['useragent'])) {
+ if (!$this->getRequest()->getHeaders()->has('User-Agent') && isset($this->config['useragent'])) {
$headers['User-Agent'] = $this->config['useragent'];
}
@@ -1078,7 +1078,7 @@ protected function prepareHeaders($body, $uri)
}
// Merge the headers of the request (if any)
- $requestHeaders = $this->getRequest()->headers()->toArray();
+ $requestHeaders = $this->getRequest()->getHeaders()->toArray();
foreach ($requestHeaders as $key => $value) {
$headers[$key] = $value;
}
@@ -1107,8 +1107,8 @@ protected function prepareBody()
$body = '';
$totalFiles = 0;
- if (!$this->getRequest()->headers()->has('Content-Type')) {
- $totalFiles = count($this->getRequest()->file()->toArray());
+ if (!$this->getRequest()->getHeaders()->has('Content-Type')) {
+ $totalFiles = count($this->getRequest()->getFile()->toArray());
// If we have files to upload, force encType to multipart/form-data
if ($totalFiles > 0) {
$this->setEncType(self::ENC_FORMDATA);
@@ -1118,26 +1118,26 @@ protected function prepareBody()
}
// If we have POST parameters or files, encode and add them to the body
- if (count($this->getRequest()->post()->toArray()) > 0 || $totalFiles > 0) {
+ if (count($this->getRequest()->getPost()->toArray()) > 0 || $totalFiles > 0) {
if (stripos($this->getEncType(), self::ENC_FORMDATA) === 0) {
$boundary = '---ZENDHTTPCLIENT-' . md5(microtime());
$this->setEncType(self::ENC_FORMDATA, $boundary);
// Get POST parameters and encode them
- $params = self::flattenParametersArray($this->getRequest()->post()->toArray());
+ $params = self::flattenParametersArray($this->getRequest()->getPost()->toArray());
foreach ($params as $pp) {
$body .= $this->encodeFormData($boundary, $pp[0], $pp[1]);
}
// Encode files
- foreach ($this->getRequest()->file()->toArray() as $key => $file) {
+ foreach ($this->getRequest()->getFile()->toArray() as $key => $file) {
$fhead = array('Content-Type' => $file['ctype']);
$body .= $this->encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
}
$body .= "--{$boundary}--\r\n";
} elseif (stripos($this->getEncType(), self::ENC_URLENCODED) === 0) {
// Encode body as application/x-www-form-urlencoded
- $body = http_build_query($this->getRequest()->post()->toArray());
+ $body = http_build_query($this->getRequest()->getPost()->toArray());
} else {
throw new Client\Exception\RuntimeException("Cannot handle content type '{$this->encType}' automatically");
}
View
4 library/Zend/Http/Client/Adapter/Proxy.php
@@ -81,7 +81,7 @@ public function connect($host, $port = 80, $secure = false)
if (! $this->config['proxy_host']) {
return parent::connect($host, $port, $secure);
}
-
+
/* Url might require stream context even if proxy connection doesn't */
if ($secure) {
$this->config['sslusecontext'] = true;
@@ -172,7 +172,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
throw new AdapterException\RuntimeException('Error writing request to server');
}
}
-
+
return $request;
}
View
36 library/Zend/Http/Client/Adapter/Socket.php
@@ -55,11 +55,11 @@ class Socket implements HttpAdapter, StreamInterface
/**
* Stream for storing output
- *
+ *
* @var resource
*/
protected $out_stream = null;
-
+
/**
* Parameters array
*
@@ -237,7 +237,7 @@ public function connect($host, $port = 80, $secure = false)
}
}
-
+
/**
* Send request to the remote server
*
@@ -279,12 +279,12 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
// Add the request body
$request .= "\r\n" . $body;
}
-
+
// Send the request
if (! @fwrite($this->socket, $request)) {
throw new AdapterException\RuntimeException('Error writing request to server');
}
-
+
if (is_resource($body)) {
if (stream_copy_to_stream($body, $this->socket) == 0) {
throw new AdapterException\RuntimeException('Error writing request to server');
@@ -312,18 +312,18 @@ public function read()
if (rtrim($line) === '') break;
}
}
-
+
$this->_checkSocketReadTimeout();
$responseObj= Response::fromString($response);
-
+
$statusCode = $responseObj->getStatusCode();
// Handle 100 and 101 responses internally by restarting the read again
if ($statusCode == 100 || $statusCode == 101) return $this->read();
// Check headers to see what kind of connection / transfer encoding we have
- $headers = $responseObj->headers();
+ $headers = $responseObj->getHeaders();
/**
* Responses to HEAD requests and 204 or 304 responses are not expected
@@ -344,7 +344,7 @@ public function read()
$transfer_encoding = $headers->get('transfer-encoding');
$content_length = $headers->get('content-length');
if ($transfer_encoding !== false) {
-
+
if (strtolower($transfer_encoding->getFieldValue()) == 'chunked') {
do {
@@ -374,7 +374,7 @@ public function read()
if ($this->out_stream) {
if (stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
$this->_checkSocketReadTimeout();
- break;
+ break;
}
} else {
$line = @fread($this->socket, $read_to - $current_pos);
@@ -398,7 +398,7 @@ public function read()
throw new AdapterException\RuntimeException('Cannot handle "' .
$transfer_encoding->getFieldValue() . '" transfer encoding');
}
-
+
// We automatically decode chunked-messages when writing to a stream
// this means we have to disallow the Zend_Http_Response to do it again
if ($this->out_stream) {
@@ -413,7 +413,7 @@ public function read()
$content_length = $content_length[count($content_length) - 1];
}
$contentLength = $content_length->getFieldValue();
-
+
$current_pos = ftell($this->socket);
$chunk = '';
@@ -424,7 +424,7 @@ public function read()
if ($this->out_stream) {
if (@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
$this->_checkSocketReadTimeout();
- break;
+ break;
}
} else {
$chunk = @fread($this->socket, $read_to - $current_pos);
@@ -447,7 +447,7 @@ public function read()
if ($this->out_stream) {
if (@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
$this->_checkSocketReadTimeout();
- break;
+ break;
}
} else {
$buff = @fread($this->socket, 8192);
@@ -504,19 +504,19 @@ protected function _checkSocketReadTimeout()
}
}
}
-
+
/**
* 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;
}
-
+
/**
* Destructor: make sure the socket is disconnected
*
View
6 library/Zend/Http/Client/Adapter/StreamInterface.php
@@ -36,11 +36,11 @@
{
/**
* Set output stream
- *
+ *
* This function sets output stream where the result will be stored.
- *
+ *
* @param resource $stream Stream to write the output to
- *
+ *
*/
function setOutputStream($stream);
}
View
10 library/Zend/Http/Client/Cookies.php
@@ -31,7 +31,7 @@
* be used along with Zend_Http_Client in order to manage cookies across HTTP requests and
* responses.
*
- * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
+ * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
* automatically from a request or manually. Then, the Cookies class can find and return the
* cookies needed for a specific HTTP request.
*
@@ -49,7 +49,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
-class Cookies //implements ParametersInterface
+class Cookies
{
/**
* Return cookie(s) as a Zend\Http\Header\Cookie object
@@ -96,7 +96,7 @@ class Cookies //implements ParametersInterface
protected $_rawCookies = array();
/**
- * Construct
+ * Construct
*
*/
public function __construct()
@@ -139,7 +139,7 @@ public function addCookie($cookie, $ref_uri = null)
*/
public function addCookiesFromResponse(Response $response, $ref_uri)
{
- $cookie_hdrs = $response->headers()->get('Set-Cookie');
+ $cookie_hdrs = $response->getHeaders()->get('Set-Cookie');
if (is_array($cookie_hdrs)) {
foreach ($cookie_hdrs as $cookie) {
@@ -375,7 +375,7 @@ public function getIterator()
}
/**
- * Tells if the array of cookies is empty
+ * Tells if the array of cookies is empty
*
* @return bool
*/
View
34 library/Zend/Http/ClientStatic.php
@@ -32,7 +32,7 @@
*/
class ClientStatic
{
-
+
protected static $client;
/**
@@ -47,7 +47,7 @@ protected static function getStaticClient()
}
return self::$client;
}
-
+
/**
* HTTP GET METHOD (static)
*
@@ -61,23 +61,23 @@ public static function get($url, $query=array(), $headers=array(), $body=null)
if (empty($url)) {
return false;
}
-
+
$request= new Request();
$request->setUri($url);
$request->setMethod(Request::METHOD_GET);
-
+
if (!empty($query) && is_array($query)) {
- $request->query()->fromArray($query);
+ $request->getQuery()->fromArray($query);
}
-
+
if (!empty($headers) && is_array($headers)) {
- $request->headers()->addHeaders($headers);
+ $request->getHeaders()->addHeaders($headers);
}
-
+
if (!empty($body)) {
$request->setBody($body);
}
-
+
return self::getStaticClient()->send($request);
}
/**
@@ -93,29 +93,29 @@ public static function post($url, $params, $headers=array(), $body=null)
if (empty($url)) {
return false;
}
-
+
$request= new Request();
$request->setUri($url);
$request->setMethod(Request::METHOD_POST);
-
+
if (!empty($params) && is_array($params)) {
- $request->post()->fromArray($params);
+ $request->getPost()->fromArray($params);
} else {
throw new Exception\InvalidArgumentException('The array of post parameters is empty');
}
-
+
if (!isset($headers['Content-Type'])) {
$headers['Content-Type']= Client::ENC_URLENCODED;
}
-
+
if (!empty($headers) && is_array($headers)) {
- $request->headers()->addHeaders($headers);
+ $request->getHeaders()->addHeaders($headers);
}
-
+
if (!empty($body)) {
$request->setContent($body);
}
-
+
return self::getStaticClient()->send($request);
}
}
View
53 library/Zend/Http/Cookies.php
@@ -11,7 +11,7 @@
* be used along with Zend_Http_Client in order to manage cookies across HTTP requests and
* responses.
*
- * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
+ * The class contains an array of Zend\Http\Header\Cookie objects. Cookies can be added
* automatically from a request or manually. Then, the Cookies class can find and return the
* cookies needed for a specific HTTP request.
*
@@ -31,48 +31,6 @@
*/
class Cookies extends Headers
{
-
-
-
-
-// /**
-// * Return cookie(s) as a Zend\Http\Header\Cookie object
-// *
-// */
-// const COOKIE_OBJECT = 0;
-//
-// /**
-// * Return cookie(s) as a string (suitable for sending in an HTTP request)
-// *
-// */
-// const COOKIE_STRING_ARRAY = 1;
-//
-// /**
-// * Return all cookies as one long string (suitable for sending in an HTTP request)
-// *
-// */
-// const COOKIE_STRING_CONCAT = 2;
-//
-// /**
-// * Array storing cookies
-// *
-// * Cookies are stored according to domain and path:
-// * $cookies
-// * + www.mydomain.com
-// * + /
-// * - cookie1
-// * - cookie2
-// * + /somepath
-// * - othercookie
-// * + www.otherdomain.net
-// * + /
-// * - alsocookie
-// *
-// * @var array
-// */
-
-
-
/**
* @var Headers
*/
@@ -92,13 +50,6 @@ public static function fromString($string)
);
}
-// /**
-// * The Zend\Http\Header\Cookie array
-// *
-// * @var array
-// */
-// protected $_rawCookies = array();
-
public function __construct(Headers $headers, $context = self::CONTEXT_REQUEST)
{
$this->headers = $headers;
@@ -358,7 +309,7 @@ public static function fromResponse(Response $response, $ref_uri)
}
/**
- * Tells if the array of cookies is empty
+ * Tells if the array of cookies is empty
*
* @return bool
*/
View
2  library/Zend/Http/Exception/RuntimeException.php
@@ -3,7 +3,7 @@
namespace Zend\Http\Exception;
class RuntimeException
- extends \RuntimeException
+ extends \RuntimeException
implements ExceptionInterface
{
}
View
8 library/Zend/Http/Headers.php
@@ -195,7 +195,7 @@ public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)
/**
* Add a Header to this container, for raw values @see addHeaderLine() and addHeaders()
- *
+ *
* @param Header\HeaderInterface $header
* @return Headers
*/
@@ -229,7 +229,7 @@ public function removeHeader(Header\HeaderInterface $header)
* Clear all headers
*
* Removes all headers from queue
- *
+ *
* @return Headers
*/
public function clearHeaders()
@@ -240,7 +240,7 @@ public function clearHeaders()
/**
* Get all headers of a certain name/type
- *
+ *
* @param string $name
* @return bool|Header\HeaderInterface|ArrayIterator
*/
@@ -279,7 +279,7 @@ public function get($name)
/**
* Test for existence of a type of header
- *
+ *
* @param string $name
* @return bool
*/
View
80 library/Zend/Http/PhpEnvironment/Request.php
@@ -28,21 +28,21 @@ class Request extends HttpRequest
{
/**
* Base URL of the application.
- *
+ *
* @var string
*/
protected $baseUrl;
-
+
/**
* Base Path of the application.
*
* @var string
*/
protected $basePath;
-
+
/**
* Actual request URI, independent of the platform.
- *
+ *
* @var string
*/
protected $requestUri;
@@ -81,7 +81,7 @@ public function __construct()
*/
public function setCookies($cookie)
{
- $this->headers()->addHeader(new Cookie((array) $cookie));
+ $this->getHeaders()->addHeader(new Cookie((array) $cookie));
return $this;
}
@@ -109,7 +109,7 @@ public function getRequestUri()
}
return $this->requestUri;
}
-
+
/**
* Set the base URL.
*
@@ -134,10 +134,10 @@ public function getBaseUrl()
}
return $this->baseUrl;
}
-
+
/**
* Set the base path.
- *
+ *
* @param string $basePath
* @return self
*/
@@ -157,7 +157,7 @@ public function getBasePath()
if ($this->basePath === null) {
$this->setBasePath($this->detectBasePath());
}
-
+
return $this->basePath;
}
@@ -182,20 +182,20 @@ public function setServer(ParametersInterface $server)
}
}
- $this->headers()->addHeaders($this->serverToHeaders($this->serverParams));
+ $this->getHeaders()->addHeaders($this->serverToHeaders($this->serverParams));
if (isset($this->serverParams['REQUEST_METHOD'])) {
$this->setMethod($this->serverParams['REQUEST_METHOD']);
}
- if (isset($this->serverParams['SERVER_PROTOCOL'])
+ if (isset($this->serverParams['SERVER_PROTOCOL'])
&& strpos($this->serverParams['SERVER_PROTOCOL'], '1.0') !== false) {
$this->setVersion('1.0');
}
$this->setUri($uri = new HttpUri());
- if (isset($this->serverParams['HTTPS']) && $this->serverParams['HTTPS'] === 'on') {
+ if (isset($this->serverParams['HTTPS']) && $this->serverParams['HTTPS'] === 'on') {
$uri->setScheme('https');
} else {
$uri->setScheme('http');
@@ -205,13 +205,13 @@ public function setServer(ParametersInterface $server)
$uri->setQuery($this->serverParams['QUERY_STRING']);
}
- if ($this->headers()->get('host')) {
+ if ($this->getHeaders()->get('host')) {
//TODO handle IPv6 with port
- if (preg_match('|^([^:]+):([^:]+)$|', $this->headers()->get('host')->getFieldValue(), $match)) {
+ if (preg_match('|^([^:]+):([^:]+)$|', $this->getHeaders()->get('host')->getFieldValue(), $match)) {
$uri->setHost($match[1]);
$uri->setPort($match[2]);
} else {
- $uri->setHost($this->headers()->get('host')->getFieldValue());
+ $uri->setHost($this->getHeaders()->get('host')->getFieldValue());
}
} elseif (isset($this->serverParams['SERVER_NAME'])) {
$uri->setHost($this->serverParams['SERVER_NAME']);
@@ -262,7 +262,7 @@ protected function serverToHeaders($server)
*
* Looks at a variety of criteria in order to attempt to autodetect a base
* URI, including rewrite URIs, proxy URIs, etc.
- *
+ *
* @return string
*/
protected function detectRequestUri()
@@ -270,43 +270,43 @@ protected function detectRequestUri()
$requestUri = null;
// Check this first so IIS will catch.
- $httpXRewriteUrl = $this->server()->get('HTTP_X_REWRITE_URL');
+ $httpXRewriteUrl = $this->getServer()->get('HTTP_X_REWRITE_URL');
if ($httpXRewriteUrl !== null) {
$requestUri = $httpXRewriteUrl;
}
-
+
// Check for IIS 7.0 or later with ISAPI_Rewrite
- $httpXOriginalUrl = $this->server()->get('HTTP_X_ORIGINAL_URL');
+ $httpXOriginalUrl = $this->getServer()->get('HTTP_X_ORIGINAL_URL');
if ($httpXOriginalUrl !== null) {
$requestUri = $httpXOriginalUrl;
}
-
+
// IIS7 with URL Rewrite: make sure we get the unencoded url
// (double slash problem).
- $iisUrlRewritten = $this->server()->get('IIS_WasUrlRewritten');
- $unencodedUrl = $this->server()->get('UNENCODED_URL', '');
+ $iisUrlRewritten = $this->getServer()->get('IIS_WasUrlRewritten');
+ $unencodedUrl = $this->getServer()->get('UNENCODED_URL', '');
if ('1' == $iisUrlRewritten && '' !== $unencodedUrl) {
return $unencodedUrl;
- }
-
+ }
+
// HTTP proxy requests setup request URI with scheme and host
// [and port] + the URL path, only use URL path.
if (!$httpXRewriteUrl) {
- $requestUri = $this->server()->get('REQUEST_URI');
+ $requestUri = $this->getServer()->get('REQUEST_URI');
}
if ($requestUri !== null) {
- $schemeAndHttpHost = $this->uri()->getScheme() . '://' . $this->uri()->getHost();
-
+ $schemeAndHttpHost = $this->getUri()->getScheme() . '://' . $this->getUri()->getHost();
+
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
}
return $requestUri;
- }
-
+ }
+
// IIS 5.0, PHP as CGI.
- $origPathInfo = $this->server()->get('ORIG_PATH_INFO');
+ $origPathInfo = $this->getServer()->get('ORIG_PATH_INFO');
if ($origPathInfo !== null) {
- $queryString = $this->server()->get('QUERY_STRING', '');
+ $queryString = $this->getServer()->get('QUERY_STRING', '');
if ($queryString !== '') {
$origPathInfo .= '?' . $queryString;
}
@@ -323,16 +323,16 @@ protected function detectRequestUri()
* (i.e., anything additional to the document root).
*
* The base URL includes the schema, host, and port, in addition to the path.
- *
+ *
* @return string
*/
protected function detectBaseUrl()
{
$baseUrl = '';
- $filename = $this->server()->get('SCRIPT_FILENAME', '');
- $scriptName = $this->server()->get('SCRIPT_NAME');
- $phpSelf = $this->server()->get('PHP_SELF');
- $origScriptName = $this->server()->get('ORIG_SCRIPT_NAME');
+ $filename = $this->getServer()->get('SCRIPT_FILENAME', '');
+ $scriptName = $this->getServer()->get('SCRIPT_NAME');
+ $phpSelf = $this->getServer()->get('PHP_SELF');
+ $origScriptName = $this->getServer()->get('ORIG_SCRIPT_NAME');
if ($scriptName !== null && basename($scriptName) === $filename) {
$baseUrl = $scriptName;
@@ -393,19 +393,19 @@ protected function detectBaseUrl()
* Autodetect the base path of the request
*
* Uses several criteria to determine the base path of the request.
- *
+ *
* @return string
*/
protected function detectBasePath()
{
- $filename = basename($this->server()->get('SCRIPT_FILENAME', ''));
+ $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
$baseUrl = $this->getBaseUrl();
// Empty base url detected
if ($baseUrl === '') {
return '';
- }
-
+ }
+
// basename() matches the script filename; return the directory
if (basename($baseUrl) === $filename) {
return str_replace('\\', '/', dirname($baseUrl));
View
14 library/Zend/Http/PhpEnvironment/Response.php
@@ -16,17 +16,17 @@ class Response extends HttpResponse
public function __construct()
{
}
-
+
public function headersSent()
{
return $this->headersSent;
}
-
+
public function contentSent()
{
return $this->contentSent;
}
-
+
public function sendHeaders()
{
if ($this->headersSent()) {
@@ -36,7 +36,7 @@ public function sendHeaders()
$status = $this->renderStatusLine();
header($status);
- foreach ($this->headers() as $header) {
+ foreach ($this->getHeaders() as $header) {
if ($header instanceof MultipleHeaderInterface) {
header($header->toString(), false);
continue;
@@ -47,7 +47,7 @@ public function sendHeaders()
$this->headersSent = true;
return $this;
}
-
+
public function sendContent()
{
if ($this->contentSent()) {
@@ -64,6 +64,6 @@ public function send()
->sendContent();
return $this;
}
-
+
}
-
+
View
28 library/Zend/Http/Request.php
@@ -194,11 +194,11 @@ public function setUri($uri)
}
/**
- * Return the URI for this request object
+ * Return the URI for this request object as a string
*
* @return string
*/
- public function getUri()
+ public function getUriString()
{
if ($this->uri instanceof HttpUri) {
return $this->uri->toString();
@@ -207,11 +207,11 @@ public function getUri()
}
/**
- * Return the URI for this request object as an instance of Zend\Uri\Http
+ * Return the URI for this request object
*
* @return HttpUri
*/
- public function uri()
+ public function getUri()
{
if ($this->uri === null || is_string($this->uri)) {
$this->uri = new HttpUri($this->uri);
@@ -263,7 +263,7 @@ public function setQuery(ParametersInterface $query)
*
* @return \Zend\Stdlib\ParametersInterface
*/
- public function query()
+ public function getQuery()
{
if ($this->queryParams === null) {
$this->queryParams = new Parameters();
@@ -290,7 +290,7 @@ public function setPost(ParametersInterface $post)
*
* @return \Zend\Stdlib\ParametersInterface
*/
- public function post()
+ public function getPost()
{
if ($this->postParams === null) {
$this->postParams = new Parameters();
@@ -305,9 +305,9 @@ public function post()
* @convenience $request->headers()->get('Cookie');
* @return Header\Cookie
*/
- public function cookie()
+ public function getCookie()
{
- return $this->headers()->get('Cookie');
+ return $this->getHeaders()->get('Cookie');
}
/**
@@ -328,7 +328,7 @@ public function setFile(ParametersInterface $files)
*
* @return ParametersInterface
*/
- public function file()
+ public function getFile()
{
if ($this->fileParams === null) {
$this->fileParams = new Parameters();
@@ -356,7 +356,7 @@ public function setServer(ParametersInterface $server)
* @see http://www.faqs.org/rfcs/rfc3875.html
* @return \Zend\Stdlib\ParametersInterface
*/
- public function server()
+ public function getServer()
{
if ($this->serverParams === null) {
$this->serverParams = new Parameters();
@@ -383,7 +383,7 @@ public function setEnv(ParametersInterface $env)
*
* @return \Zend\Stdlib\ParametersInterface
*/
- public function env()
+ public function getEnv()
{
if ($this->envParams === null) {
$this->envParams = new Parameters();
@@ -410,7 +410,7 @@ public function setHeaders(Headers $headers)
*
* @return \Zend\Http\Headers
*/
- public function headers()
+ public function getHeaders()
{
if ($this->headers === null || is_string($this->headers)) {
// this is only here for fromString lazy loading
@@ -509,7 +509,7 @@ public function isConnect()
*/
public function isXmlHttpRequest()
{
- $header = $this->headers()->get('X_REQUESTED_WITH');
+ $header = $this->getHeaders()->get('X_REQUESTED_WITH');
return false !== $header && $header->getFieldValue() == 'XMLHttpRequest';
}
@@ -520,7 +520,7 @@ public function isXmlHttpRequest()
*/
public function isFlashRequest()
{
- $header = $this->headers()->get('USER_AGENT');
+ $header = $this->getHeaders()->get('USER_AGENT');
return false !== $header && stristr($header->getFieldValue(), ' flash');
}
View
12 library/Zend/Http/Response.php
@@ -257,7 +257,7 @@ public function setHeaders(Headers $headers)
*
* @return Headers
*/
- public function headers()
+ public function getHeaders()
{
if ($this->headers === null || is_string($this->headers)) {
$this->headers = (is_string($this->headers)) ? Headers::fromString($this->headers) : new Headers();
@@ -268,9 +268,9 @@ public function headers()
/**
* @return Header\SetCookie[]
*/
- public function cookie()
+ public function getCookie()
{
- return $this->headers()->get('Set-Cookie');
+ return $this->getHeaders()->get('Set-Cookie');
}
/**
@@ -354,7 +354,7 @@ public function getBody()
{
$body = (string) $this->getContent();
- $transferEncoding = $this->headers()->get('Transfer-Encoding');
+ $transferEncoding = $this->getHeaders()->get('Transfer-Encoding');
if (!empty($transferEncoding)) {
if (strtolower($transferEncoding->getFieldValue()) == 'chunked') {
@@ -362,7 +362,7 @@ public function getBody()
}
}
- $contentEncoding = $this->headers()->get('Content-Encoding');
+ $contentEncoding = $this->getHeaders()->get('Content-Encoding');
if (!empty($contentEncoding)) {
$contentEncoding = $contentEncoding->getFieldValue();
@@ -470,7 +470,7 @@ public function isSuccess()
public function toString()
{
$str = $this->renderStatusLine() . "\r\n";
- $str .= $this->headers()->toString();
+ $str .= $this->getHeaders()->toString();
$str .= "\r\n";
$str .= $this->getContent();
return $str;
View
44 library/Zend/Http/Response/Stream.php
@@ -37,21 +37,21 @@
*/
class Stream extends Response
{
-
+
/**
* The Content-Length value, if set
*
* @var int
*/
protected $contentLength = null;
-
+
/**
* The portion of the body that has alredy been streamed
*
* @var int
*/
protected $contentStreamed = 0;
-
+
/**
* Response as stream
*
@@ -139,7 +139,7 @@ public function setStreamName($streamName)
return $this;
}
-
+
/**
* Create a new Zend\Http\Response\Stream object from a stream
*
@@ -149,14 +149,14 @@ public function setStreamName($streamName)
*/
public static function fromStream($responseString, $stream)
{
-
+
if (!is_resource($stream)) {
throw new Exception\InvalidArgumentException('A valid stream is required');
}
$headerComplete = false;
$headersString = '';
-
+
$responseArray = explode("\n",$responseString);
while (count($responseArray)) {
@@ -167,35 +167,35 @@ public static function fromStream($responseString, $stream)
$headerComplete = true;
break;
}
-
+
}
-
+
if (!$headerComplete) {
while (false !== ($nextLine = fgets($stream))) {
-
+
$headersString .= trim($nextLine)."\r\n";
if ($nextLine == "\r\n" || $nextLine == "\n") {
$headerComplete = true;
break;
}
}
- }
+ }
if (!$headerComplete) {
throw new Exception\OutOfRangeException('End of header not found');
}
-
+
$response = static::fromString($headersString);
-
+
if (is_resource($stream)) {
$response->setStream($stream);
}
-
+
if (count($responseArray)) {
$response->content = implode("\n", $responseArray);
- }
-
- $headers = $response->headers();
+ }
+
+ $headers = $response->getHeaders();
foreach($headers as $header) {
if ($header instanceof \Zend\Http\Header\ContentLength) {
$response->contentLength = (int) $header->getFieldValue();
@@ -210,8 +210,8 @@ public static function fromStream($responseString, $stream)
return $response;
}
-
-
+
+
/**
* Get the response body as string
*
@@ -248,7 +248,7 @@ public function getRawBody()
return $this->content;
}
-
+
/**
* Read stream content and return it as string
*
@@ -267,15 +267,15 @@ protected function readStream()
if (!is_resource($this->stream) || $bytes == 0) {
return '';
}
-
+
$this->content .= stream_get_contents($this->stream, $bytes);
$this->contentStreamed += strlen($this->content);
-
+
if ($this->contentLength == $this->contentStreamed) {
$this->stream = null;
}
}
-
+
/**
* Destructor
*/
View
4 library/Zend/Json/Server/Client.php
@@ -134,11 +134,11 @@ public function doRequest($request)
$this->lastRequest = $request;
$httpRequest = $this->httpClient->getRequest();
- if ($httpRequest->getUri() === null) {
+ if ($httpRequest->getUriString() === null) {
$this->httpClient->setUri($this->serverAddress);
}
- $headers = $httpRequest->headers();
+ $headers = $httpRequest->getHeaders();
$headers->addHeaders(array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
View
8 library/Zend/Mvc/Controller/AbstractRestfulController.php
@@ -200,7 +200,7 @@ public function execute(MvcEvent $e)
$return = $this->get($id);
break;
}
- if (null !== $id = $request->query()->get('id')) {
+ if (null !== $id = $request->getQuery()->get('id')) {
$action = 'get';
$return = $this->get($id);
break;
@@ -210,11 +210,11 @@ public function execute(MvcEvent $e)
break;
case 'post':
$action = 'create';
- $return = $this->create($request->post()->toArray());
+ $return = $this->create($request->getPost()->toArray());
break;
case 'put':
if (null === $id = $routeMatch->getParam('id')) {
- if (!($id = $request->query()->get('id', false))) {
+ if (!($id = $request->getQuery()->get('id', false))) {
throw new \DomainException('Missing identifier');
}
}
@@ -225,7 +225,7 @@ public function execute(MvcEvent $e)
break;
case 'delete':
if (null === $id = $routeMatch->getParam('id')) {
- if (!($id = $request->query()->get('id', false))) {
+ if (!($id = $request->getQuery()->get('id', false))) {
throw new \DomainException('Missing identifier');
}
}
View
4 library/Zend/Mvc/Controller/Plugin/Params.php
@@ -76,7 +76,7 @@ public function fromRoute($param, $default = null)
*/
public function fromPost($param, $default = null)
{
- return $this->getController()->getRequest()->post()->get($param, $default);
+ return $this->getController()->getRequest()->getPost()->get($param, $default);
}
/**
@@ -88,6 +88,6 @@ public function fromPost($param, $default = null)
*/
public function fromQuery($param, $default = null)
{
- return $this->getController()->getRequest()->query()->get($param, $default);
+ return $this->getController()->getRequest()->getQuery()->get($param, $default);
}
}
View
4 library/Zend/Mvc/Controller/Plugin/Redirect.php
@@ -58,7 +58,7 @@ public function toRoute($route, array $params = array(), array $options = array(
$options['name'] = $route;
$url = $router->assemble($params, $options);
- $response->headers()->addHeaderLine('Location', $url);
+ $response->getHeaders()->addHeaderLine('Location', $url);
$response->setStatusCode(302);
return $response;
}
@@ -72,7 +72,7 @@ public function toRoute($route, array $params = array(), array $options = array(
public function toUrl($url)
{
$response = $this->getResponse();
- $response->headers()->addHeaderLine('Location', $url);
+ $response->getHeaders()->addHeaderLine('Location', $url);
$response->setStatusCode(302);
return $response;
}
View
4 library/Zend/Mvc/Router/Http/Hostname.php
@@ -119,11 +119,11 @@ public static function factory($options = array())
*/
public function match(Request $request)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$hostname = explode('.', $uri->getHost());
$params = array();
View
4 library/Zend/Mvc/Router/Http/Literal.php
@@ -100,11 +100,11 @@ public static function factory($options = array())
*/
public function match(Request $request, $pathOffset = null)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$path = $uri->getPath();
if ($pathOffset !== null) {
View
4 library/Zend/Mvc/Router/Http/Part.php
@@ -141,7 +141,7 @@ public function match(Request $request, $pathOffset = null)
$match = $this->route->match($request, $pathOffset);
- if ($match !== null && method_exists($request, 'uri')) {
+ if ($match !== null && method_exists($request, 'getUri')) {
if ($this->childRoutes !== null) {
$this->addRoutes($this->childRoutes);
$this->childRoutes = null;
@@ -149,7 +149,7 @@ public function match(Request $request, $pathOffset = null)
$nextOffset = $pathOffset + $match->getLength();
- $uri = $request->uri();
+ $uri = $request->getUri();
$pathLength = strlen($uri->getPath());
if ($this->mayTerminate && $nextOffset === $pathLength) {
View
4 library/Zend/Mvc/Router/Http/Query.php
@@ -98,11 +98,11 @@ public static function factory($options = array())
*/
public function match(Request $request, $pathOffset = null)
{
- if (!method_exists($request, 'query')) {
+ if (!method_exists($request, 'getQuery')) {
return null;
}
- $matches = $this->recursiveUrldecode($request->query()->toArray());
+ $matches = $this->recursiveUrldecode($request->getQuery()->toArray());
return new RouteMatch(array_merge($this->defaults, $matches));
}
View
4 library/Zend/Mvc/Router/Http/Regex.php
@@ -121,11 +121,11 @@ public static function factory($options = array())
*/
public function match(Request $request, $pathOffset = null)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$path = $uri->getPath();
if ($pathOffset !== null) {
View
4 library/Zend/Mvc/Router/Http/Scheme.php
@@ -99,11 +99,11 @@ public static function factory($options = array())
*/
public function match(Request $request)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$scheme = $uri->getScheme();
if ($scheme !== $this->scheme) {
View
4 library/Zend/Mvc/Router/Http/Segment.php
@@ -321,11 +321,11 @@ protected function buildPath(array $parts, array $mergedParams, $isOptional, $ha
*/
public function match(Request $request, $pathOffset = null)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$path = $uri->getPath();
if ($pathOffset !== null) {
View
4 library/Zend/Mvc/Router/Http/TreeRouteStack.php
@@ -145,7 +145,7 @@ protected function routeFromArray($specs)
*/
public function match(Request $request)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
@@ -153,7 +153,7 @@ public function match(Request $request)
$this->setBaseUrl($request->getBaseUrl());
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$baseUrlLength = strlen($this->baseUrl) ?: null;
if ($this->requestUri === null) {
View
4 library/Zend/Mvc/Router/Http/Wildcard.php
@@ -120,11 +120,11 @@ public static function factory($options = array())
*/
public function match(Request $request, $pathOffset = null)
{
- if (!method_exists($request, 'uri')) {
+ if (!method_exists($request, 'getUri')) {
return null;
}
- $uri = $request->uri();
+ $uri = $request->getUri();
$path = $uri->getPath();
if ($pathOffset !== null) {
View
14 library/Zend/OAuth/Client.php
@@ -232,7 +232,7 @@ public function prepareOAuth()
switch ($requestScheme) {
case OAuth::REQUEST_SCHEME_HEADER:
$oauthHeaderValue = $this->getToken()->toHeader(
- $this->getRequest()->getUri(),
+ $this->getRequest()->getUriString(),
$this->_config,
$this->_getSignableParameters()
);
@@ -247,7 +247,7 @@ public function prepareOAuth()
);
}
$query = $this->getToken()->toQueryString(
- $this->getRequest()->getUri(),
+ $this->getRequest()->getUriString(),
$this->_config,
$this->_getSignableParameters()
);
@@ -256,7 +256,7 @@ public function prepareOAuth()
break;
case OAuth::REQUEST_SCHEME_QUERYSTRING:
$query = $this->getToken()->toQueryString(
- $this->getRequest()->getUri(),
+ $this->getRequest()->getUriString(),
$this->_config,
$this->_getSignableParameters()
);
@@ -277,12 +277,12 @@ public function prepareOAuth()
protected function _getSignableParameters()
{
$params = array();
- if ($this->getRequest()->query()->count() > 0) {
- $params = array_merge($params, $this->getRequest()->query()->toArray());
+ if ($this->getRequest()->getQuery()->count() > 0) {
+ $params = array_merge($params, $this->getRequest()->getQuery()->toArray());
}
- if ($this->getRequest()->post()->count() > 0) {
- $params = array_merge($params, $this->getRequest()->post()->toArray());
+ if ($this->getRequest()->getPost()->count() > 0) {
+ $params = array_merge($params, $this->getRequest()->getPost()->toArray());
}