From 2d6a04d5148fbb5d0247867c7322dcb7a1e4429b Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sun, 25 Aug 2013 22:25:02 -0700 Subject: [PATCH] Made default properties into class variables. --- flight/net/Request.php | 92 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/flight/net/Request.php b/flight/net/Request.php index 5fc4316..0100634 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -33,6 +33,96 @@ use flight\util\Collection; * files - Uploaded files */ class Request { + /** + * @var string URL being requested + */ + public $url; + + /** + * @var string Parent subdirectory of the URL + */ + public $base; + + /** + * @var string Request method (GET, POST, PUT, DELETE) + */ + public $method; + + /** + * @var string Referrer URL + */ + public $referrer; + + /** + * @var string IP address of the client + */ + public $ip; + + /** + * @var bool Whether the request is an AJAX request + */ + public $ajax; + + /** + * @var string Server protocol (http, https) + */ + public $scheme; + + /** + * @var string Browser information + */ + public $user_agent; + + /** + * @var mixed Raw data from the request body + */ + public $body; + + /** + * @var string Content type + */ + public $type; + + /** + * @var int Content length + */ + public $length; + + /** + * @var \flight\util\Collection Query string parameters + */ + public $query; + + /** + * @var \flight\util\Collection Post parameters + */ + public $data; + + /** + * @var \flight\util\Collection Cookie parameters + */ + public $cookies; + + /** + * @var \flight\util\Collection Uploaded files + */ + public $files; + + /** + * @var bool Whether the connection is secure + */ + public $secure; + + /** + * @var string HTTP accept parameters + */ + public $accept; + + /** + * @var string Proxy IP address of the client + */ + public $proxy_ip; + /** * Constructor. * @@ -71,7 +161,7 @@ class Request { * * @param array $properties Array of request properties */ - public function init($properties) { + public function init($properties = array()) { foreach ($properties as $name => $value) { $this->$name = $value; }