Inherits WebRequest.
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 |
Definition at line 672 of file WebRequest.php.
FauxRequest::appendQuery | ( | $ | query | ) |
Take an arbitrary query and rewrite the present URL to include it.
$query | String: query string fragment; do not include initial '?' |
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).
Reimplemented from WebRequest.
Definition at line 708 of file WebRequest.php.
FauxRequest::FauxRequest | ( | $ | data, | |
$ | wasPosted = false , |
|||
$ | session = null | |||
) |
$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.
$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.
Reimplemented from WebRequest.
Definition at line 712 of file WebRequest.php.
References notImplemented().
FauxRequest::getSessionData | ( | $ | 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).
$name | string | |
$default | string: optional |
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.
Reimplemented from WebRequest.
Definition at line 704 of file WebRequest.php.
Referenced by FauxRequest().
FauxRequest::$wasPosted = false |