Home  Support  API

WebRequest Class Reference
[Web]


Encapsulates the request invoked over HTTP.

Definition at line 24 of file WebRequest.class.php.

Inheritance diagram for WebRequest:
Inheritance graph

List of all members.

Public Member Functions

 __clone ()
 __construct (WebRequestDictionary $dictonary, array $getVars, array $postVars, array $cookieVars, array $filesVars, $baseHost=null, $baseUri= '/')
 getCookieVars ()
 Gets the set of variables that passed via cookies.
 getFilesVars ()
 Gets the set of variables that described as incoming files.
 getGetVars ()
 Gets the set of variables passed via the query string.
 getHttpReferer ()
 Gets the HTTP referer, if any.
 getHttpUrl ()
 Gets the request URL.
 getPostVars ()
 Gets the set of variables passed via POST part of the request.
 getProtocol ()
 Gets the HTTP protocol.
 getRequestMethod ()
 Gets the request method.
 getVar ($variableName, WebRequestPart $part=null)
 Gets the variable from the specified request part.
 hasVar ($variableName, WebRequestPart $part=null)
 Determines whether variable is set in any of the request part.
 isSecured ()
 Specifies whether request is secured and passed over HTTPS protocol.
 offsetExists ($offset)
 Defines an interface for easy access to request variable.
 offsetGet ($offset)
 Defines an interface for easy access to request variable.
 offsetSet ($offset, $value)
 Not implemented, and won't be.
 offsetUnset ($offset)
 Not implemented, and won't be.

Constructor & Destructor Documentation

WebRequest::__construct ( WebRequestDictionary dictonary,
array $  getVars,
array $  postVars,
array $  cookieVars,
array $  filesVars,
baseHost = null,
baseUri = '/' 
)
Parameters:
WebRequestDictionary $dictonary
array $getVars request's $_GET
array $postVars request's $_POST
array $cookieVars request's $_COOKIE
array $filesVars request's $_FILES
string|null $baseHost optional base host for request's request url (SiteUrl)
string $baseUri optional base uri

Definition at line 54 of file WebRequest.class.php.

References WebRequestPart::COOKIE, WebRequestPart::FILES, WebRequestPart::GET, Dictionary::getFields(), SiteUrl::import(), Assert::isScalar(), and WebRequestPart::POST.


Member Function Documentation

WebRequest::__clone (  ) 

Definition at line 84 of file WebRequest.class.php.

WebRequest::getCookieVars (  ) 

Gets the set of variables that passed via cookies.

Returns:
array

Definition at line 169 of file WebRequest.class.php.

WebRequest::getFilesVars (  ) 

Gets the set of variables that described as incoming files.

Returns:
array

Definition at line 179 of file WebRequest.class.php.

WebRequest::getGetVars (  ) 

Gets the set of variables passed via the query string.

Returns:
array

Definition at line 149 of file WebRequest.class.php.

WebRequest::getHttpReferer (  ) 

Gets the HTTP referer, if any.

Returns:
HttpUrl|null

Definition at line 114 of file WebRequest.class.php.

References WebRequestDictionary::HTTP_REFERER.

WebRequest::getHttpUrl (  ) 

Gets the request URL.

Returns:
SiteUrl|null

Definition at line 139 of file WebRequest.class.php.

WebRequest::getPostVars (  ) 

Gets the set of variables passed via POST part of the request.

Returns:
array

Definition at line 159 of file WebRequest.class.php.

WebRequest::getProtocol (  ) 

Gets the HTTP protocol.

Returns:
string eigher HTTP/1.0 or HTTP/1.1

Definition at line 104 of file WebRequest.class.php.

References WebRequestDictionary::PROTOCOL.

WebRequest::getRequestMethod (  ) 

Gets the request method.

Returns:
RequestMethod

Definition at line 94 of file WebRequest.class.php.

References WebRequestDictionary::REQUEST_METHOD.

WebRequest::getVar ( variableName,
WebRequestPart part = null 
)

Gets the variable from the specified request part.

Exceptions:
ArgumentException if such variable does not exist
Parameters:
string $variableName name of the variable to be retreived from the request
WebRequestPart $part optional specification of request scope where variable should be looked up
Returns:
scalar

Definition at line 212 of file WebRequest.class.php.

WebRequest::hasVar ( variableName,
WebRequestPart part = null 
)

Determines whether variable is set in any of the request part.

Parameters:
string $variableName name of the variable to be retreived from the request
WebRequestPart $part optional specification of request scope where variable should be looked up
Returns:
boolean

Definition at line 193 of file WebRequest.class.php.

WebRequest::isSecured (  ) 

Specifies whether request is secured and passed over HTTPS protocol.

Returns:
boolean

Definition at line 129 of file WebRequest.class.php.

References HttpUrlDictionary::HTTPS.

WebRequest::offsetExists ( offset  ) 

Defines an interface for easy access to request variable.

Variable is looked up within all request parts.

Returns:
boolean

Definition at line 232 of file WebRequest.class.php.

WebRequest::offsetGet ( offset  ) 

Defines an interface for easy access to request variable.

Variable is looked up within all request parts.

Returns:
mixed

Definition at line 243 of file WebRequest.class.php.

WebRequest::offsetSet ( offset,
value 
)

Not implemented, and won't be.

Returns:
void

Definition at line 253 of file WebRequest.class.php.

References Assert::isUnreachable().

WebRequest::offsetUnset ( offset  ) 

Not implemented, and won't be.

Returns:
void

Definition at line 263 of file WebRequest.class.php.

References Assert::isUnreachable().


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