FauxRequest Class Reference
[HTTP]

WebRequest clone which takes values from a provided array. More...

Inherits WebRequest.

List of all members.

Public Member Functions

 FauxRequest ($data, $wasPosted=false, $session=null)
 notImplemented ($method)
 getText ($name, $default= '')
 Fetch a text string from the given array or return $default if it's not set.
 getValues ()
 Extracts the given named values into an array.
 wasPosted ()
 Returns true if the present request was reached by a POST operation, false otherwise (GET, HEAD, or command-line).
 checkSessionCookie ()
 Returns true if there is a session cookie set.
 getRequestURL ()
 Return the path portion of the request URI.
 appendQuery ($query)
 Take an arbitrary query and rewrite the present URL to include it.
 getHeader ($name)
 Get a request header, or false if it isn't set.
 getSessionData ($key)
 setSessionData ($key, $data)

Public Attributes

 $wasPosted = false


Detailed Description

WebRequest clone which takes values from a provided array.

Definition at line 672 of file WebRequest.php.


Member Function Documentation

FauxRequest::appendQuery ( query  ) 

Take an arbitrary query and rewrite the present URL to include it.

Parameters:
$query String: query string fragment; do not include initial '?'
Returns:
string

Reimplemented from WebRequest.

Definition at line 716 of file WebRequest.php.

References notImplemented().

FauxRequest::checkSessionCookie (  ) 

Returns true if there is a session cookie set.

This does not necessarily mean that the user is logged in!

If you want to check for an open session, use session_id() instead; that will also tell you if the session was opened during the current request (in which case the cookie will be sent back to the client at the end of the script run).

Returns:
bool

Reimplemented from WebRequest.

Definition at line 708 of file WebRequest.php.

FauxRequest::FauxRequest ( data,
wasPosted = false,
session = null 
)

Parameters:
$data Array of *non*-urlencoded key => value pairs, the fake GET/POST values
$wasPosted Bool: whether to treat the data as POST

Definition at line 680 of file WebRequest.php.

References WebRequest::$data, $session, $wasPosted, and wasPosted().

FauxRequest::getHeader ( name  ) 

Get a request header, or false if it isn't set.

Parameters:
$name String: case-insensitive header name

Reimplemented from WebRequest.

Definition at line 720 of file WebRequest.php.

References $name.

FauxRequest::getRequestURL (  ) 

Return the path portion of the request URI.

Returns:
string

Reimplemented from WebRequest.

Definition at line 712 of file WebRequest.php.

References notImplemented().

FauxRequest::getSessionData ( key  ) 

Reimplemented from WebRequest.

Definition at line 724 of file WebRequest.php.

References $key.

FauxRequest::getText ( name,
default = '' 
)

Fetch a text string from the given array or return $default if it's not set.

is stripped from the text, and with some language modules there is an input transliteration applied. This should generally be used for form <textarea> and <input> fields. Used for user-supplied freeform text input (for which input transformations may be required - e.g. Esperanto x-coding).

Parameters:
$name string
$default string: optional
Returns:
string

Reimplemented from WebRequest.

Definition at line 695 of file WebRequest.php.

References $name, and WebRequest::getVal().

FauxRequest::getValues (  ) 

Extracts the given named values into an array.

If no arguments are given, returns all input values. No transformation is performed on the values.

Reimplemented from WebRequest.

Definition at line 700 of file WebRequest.php.

FauxRequest::notImplemented ( method  ) 

Definition at line 691 of file WebRequest.php.

Referenced by appendQuery(), getRequestURL(), and setSessionData().

FauxRequest::setSessionData ( key,
data 
)

Reimplemented from WebRequest.

Definition at line 729 of file WebRequest.php.

References notImplemented().

FauxRequest::wasPosted (  ) 

Returns true if the present request was reached by a POST operation, false otherwise (GET, HEAD, or command-line).

Note that values retrieved by the object may come from the GET URL etc even on a POST request.

Returns:
bool

Reimplemented from WebRequest.

Definition at line 704 of file WebRequest.php.

Referenced by FauxRequest().


Member Data Documentation

FauxRequest::$wasPosted = false

Definition at line 673 of file WebRequest.php.

Referenced by FauxRequest().


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

Generated on Sat Sep 5 02:08:37 2009 for MediaWiki by  doxygen 1.5.9