spunQ_CurrentHttpRequest Class Reference

Wrapper for lots of global variables. More...

Inheritance diagram for spunQ_CurrentHttpRequest:

spunQ_IHttpRequest

List of all members.

Public Member Functions

 getHttpVersion ()
 Provides the http version used for the request.
 getRequestMethod ()
 Provides the request method.
 getHttpHeaders ()
 Provides all HTTP headers of the request.
 getHttpHeaderValue ($header)
 Provides a single HTTP header value.
 usesSsl ()
 Whether the request was sent through a secure connection.
 isAjax ()
 Determines if a request was sent via ajax.
 getHost ()
 Provides the host this request was directed at.
 getUrl ($includeQueryString=true)
 Provides the requested URL.
 getClientInformation ()
 Provides the client information extracted from HTTP headers.
 getRequestDateTime ()
 Provides the datetime the request was received.
 getCookies ()
 Provides all cookies sent with the request.
 getCookieValue ($cookie)
 Provides a single cookie sent with the request.
 getGetValues ()
 Provides the GET parameters of this request.
 getGetValue ($name)
 Provides a single GET parameter value sent with the request.
 getPostValues ()
 Provides the POST parameters of this request.
 getPostValue ($name)
 Provides a single PAST parameter value sent with the request.
 getUploadedFiles ()
 Provides the all files that have been uploaded.
 getUploadedFile ($name)
 Provides a single file that has been uploaded.
 getLocale ()
 Provides the spunQ_Locale the request was made in.
 getRawPostData ()
 Returns the raw post data string to be re-used.

Static Public Member Functions

static getInstance ()
 Gets the singleton instance of this class.

Public Attributes

const REQUEST_UNKNOWN = 0
 Unknown request type.
const REQUEST_GET = 1
 Http Get request.
const REQUEST_POST = 2
 Http Post request.
const REQUEST_HEAD = 4
 Http Head request.
const REQUEST_PUT = 8
 Http Put request.
const HTTP_VERSION_UNKNOWN = 0
 Unknown http version.
const HTTP_VERSION_1_0 = 1
 Http version 1.0.
const HTTP_VERSION_1_1 = 2
 Http version 1.1.

Protected Attributes

 $clientInformation = NULL
 Information about the client making the request.
 $locale = NULL

Private Member Functions

 __construct ()
 Constructor.

Private Attributes

 $httpHeaders = NULL
 All HTTP headers that were sent along with this request.
 $requestDateTime = NULL
 DateTime the request was received.
 $uploadedFiles = NULL
 Files that have been uploaded.

Static Private Attributes

static $instance = NULL
 The singleton instance of this class.


Detailed Description

Wrapper for lots of global variables.

Definition at line 6 of file CurrentHttpRequest.class.php.


Member Function Documentation

spunQ_CurrentHttpRequest::getClientInformation (  ) 

Provides the client information extracted from HTTP headers.

Please note that all client information is unsafe, HTTP headers can be set arbitrarily by the requestor.

Returns:
spunQ_IHttpClientInformation

Implements spunQ_IHttpRequest.

Definition at line 168 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getCookies (  ) 

Provides all cookies sent with the request.

Returns:
array Associative array mapping cookie names to their value.

Implements spunQ_IHttpRequest.

Definition at line 203 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getCookieValue ( cookie  ) 

Provides a single cookie sent with the request.

Parameters:
$cookie Name of the cookie to be retrieved.
Returns:
string? NULL if no such cookie was received.

Implements spunQ_IHttpRequest.

Definition at line 210 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getGetValue ( name  ) 

Provides a single GET parameter value sent with the request.

Parameters:
$name Name of the parameter to be retrieved.
Returns:
string? NULL if no such parameter was received.

Implements spunQ_IHttpRequest.

Definition at line 227 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getGetValues (  ) 

Provides the GET parameters of this request.

These are the parameters passed as the query string of the URL.

Returns:
array Associative array mapping parameter names to their value.

Implements spunQ_IHttpRequest.

Definition at line 220 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getHost (  ) 

Provides the host this request was directed at.

Returns:
string? Might be NULL if the IP address was used (and accepted by the web server).

Implements spunQ_IHttpRequest.

Definition at line 141 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getHttpHeaders (  ) 

Provides all HTTP headers of the request.

Returns:
array Associative array mapping headers to their values.

Implements spunQ_IHttpRequest.

Definition at line 97 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getHttpHeaderValue ( header  ) 

Provides a single HTTP header value.

Returns:
string? NULL if no such header was received.

Implements spunQ_IHttpRequest.

Definition at line 112 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getHttpVersion (  ) 

Provides the http version used for the request.

Returns:
integer Either of the HTTP_VERSION_* constants.

Implements spunQ_IHttpRequest.

Definition at line 64 of file CurrentHttpRequest.class.php.

static spunQ_CurrentHttpRequest::getInstance (  )  [static]

Gets the singleton instance of this class.

Returns:
spunQ_CurrentHttpRequest

Definition at line 18 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getLocale (  ) 

Provides the spunQ_Locale the request was made in.

Will fall back to the default locale if no explicit locale was passed with the url.

See also:
spunQ_HttpResponse::getDefaultLocale()
Returns:
spunQ_Locale

Definition at line 288 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getPostValue ( name  ) 

Provides a single PAST parameter value sent with the request.

Parameters:
$name Name of the parameter to be retrieved.
Returns:
string? NULL if no such parameter was received.

Implements spunQ_IHttpRequest.

Definition at line 244 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getPostValues (  ) 

Provides the POST parameters of this request.

These are the parameters passed as the query string of the URL.

Returns:
array Associative array mapping parameter names to their value.

Implements spunQ_IHttpRequest.

Definition at line 237 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getRawPostData (  ) 

Returns the raw post data string to be re-used.

Returns:
string

Definition at line 312 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getRequestDateTime (  ) 

Provides the datetime the request was received.

Returns:
spunQ_DateTime

Implements spunQ_IHttpRequest.

Definition at line 182 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getRequestMethod (  ) 

Provides the request method.

Returns:
integer Either of the REQUEST_* constants.

Implements spunQ_IHttpRequest.

Definition at line 76 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getUploadedFile ( name  ) 

Provides a single file that has been uploaded.

Parameters:
$name Name of the file upload field to retrieve
Returns:
spunQ_File The file has the name it had on the machine the user had submitted the form from.

Implements spunQ_IHttpRequest.

Definition at line 271 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getUploadedFiles (  ) 

Provides the all files that have been uploaded.

Returns:
array Associative array mapping names of the file upload field names to files in [temporary] folders. The files have the name they had on the machine the user had submitted the form from.

Implements spunQ_IHttpRequest.

Definition at line 254 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::getUrl ( includeQueryString = true  ) 

Provides the requested URL.

Parameters:
$includeQueryString The function will remove the query string if this is passed as false.
Returns:
string

Implements spunQ_IHttpRequest.

Definition at line 151 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::isAjax (  ) 

Determines if a request was sent via ajax.

Returns:
boolean

Implements spunQ_IHttpRequest.

Definition at line 134 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::usesSsl (  ) 

Whether the request was sent through a secure connection.

Returns:
boolean

Implements spunQ_IHttpRequest.

Definition at line 124 of file CurrentHttpRequest.class.php.


Member Data Documentation

spunQ_CurrentHttpRequest::$clientInformation = NULL [protected]

Information about the client making the request.

Type:
spunQ.html.HttpClientInformation

Definition at line 52 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::$httpHeaders = NULL [private]

All HTTP headers that were sent along with this request.

Initialized on demand in getHttpHeaders()/getHttpHeaderValue().

Type:
array Associatve array mapping header names (in lower case) to their values.

Definition at line 31 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::$instance = NULL [static, private]

The singleton instance of this class.

Type:
spunQ_CurrentHttpRequest

Definition at line 12 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::$requestDateTime = NULL [private]

DateTime the request was received.

Initialized on demand in getRequestDateTime().

Type:
spunQ_DateTime

Definition at line 38 of file CurrentHttpRequest.class.php.

spunQ_CurrentHttpRequest::$uploadedFiles = NULL [private]

Files that have been uploaded.

Initialized on demand in getUploadedFiles()/getUploadedFile().

Type:
array Associatve array mapping HTML field names to temporary spunQ_File objects.

Definition at line 46 of file CurrentHttpRequest.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:39 2011 for spunQ3 by  doxygen 1.5.9