refactoring various things.

This commit is contained in:
Taylor Otwell
2011-09-16 19:59:20 -05:00
parent 1b75302d8c
commit 77dc8d2014
10 changed files with 139 additions and 120 deletions

View File

@@ -9,13 +9,6 @@ class Request {
*/
public $server;
/**
* The route handling the current request.
*
* @var Routing\Route
*/
public $route;
/**
* The $_POST array for the request.
*
@@ -40,6 +33,13 @@ class Request {
*/
protected $uri;
/**
* The route handling the current request.
*
* @var Routing\Route
*/
public $route;
/**
* Create a new request instance.
*
@@ -84,7 +84,10 @@ class Request {
throw new \Exception('Unable to determine the request URI.');
}
if ($uri === false) throw new \Exception('Malformed request URI. Request terminated.');
if ($uri === false)
{
throw new \Exception('Malformed request URI. Request terminated.');
}
foreach (array(parse_url($this->url, PHP_URL_PATH), '/index.php') as $value)
{
@@ -117,7 +120,7 @@ class Request {
*/
public function method()
{
return ($this->spoofed()) ? $this->post['REQUEST_METHOD'] : $this->server['REQUEST_METHOD'];
return ($this->spoofed()) ? $this->post['_REQUEST_METHOD'] : $this->server['REQUEST_METHOD'];
}
/**