MediaWiki  REL1_19
FauxRequest Class Reference

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

Inheritance diagram for FauxRequest:
Collaboration diagram for FauxRequest:

List of all members.

Public Member Functions

 __construct ($data=array(), $wasPosted=false, $session=null)
 checkSessionCookie ()
 Returns true if there is a session cookie set.
 checkUrlExtension ($extWhitelist=array())
 getCookie ($key, $prefix=null, $default=null)
 Get a cookie from the $_COOKIE jar.
 getHeader ($name)
 getQueryValues ()
 getRequestURL ()
 Return the path and query string portion of the request URI.
 getSessionArray ()
 getSessionData ($key)
 getText ($name, $default= '')
 getValues ()
 isPathInfoBad ($extWhitelist=array())
 setHeader ($name, $val)
 setSessionData ($key, $data)
 wasPosted ()

Protected Member Functions

 getRawIP ()

Private Member Functions

 notImplemented ($method)

Private Attributes

 $session = array()
 $wasPosted = false

Detailed Description

WebRequest clone which takes values from a provided array.

Definition at line 1197 of file WebRequest.php.


Constructor & Destructor Documentation

FauxRequest::__construct ( data = array(),
wasPosted = false,
session = null 
)
Parameters:
$dataArray of *non*-urlencoded key => value pairs, the fake GET/POST values
$wasPostedBool: whether to treat the data as POST
$sessionMixed: session array or null

Definition at line 1207 of file WebRequest.php.

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

Here is the call graph for this function:


Member Function Documentation

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:
Boolean

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1265 of file WebRequest.php.

FauxRequest::checkUrlExtension ( extWhitelist = array())
Parameters:
array$extWhitelist
Returns:
bool

Reimplemented from WebRequest.

Definition at line 1325 of file WebRequest.php.

FauxRequest::getCookie ( key,
prefix = null,
default = null 
)

Get a cookie from the $_COOKIE jar.

Parameters:
$keyString: the name of the cookie
$prefixString: a prefix to use for the cookie name, if not $wgCookiePrefix
$defaultMixed: what to return if the value isn't found
Returns:
Mixed: cookie value or $default if the cookie not set

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1261 of file WebRequest.php.

Parameters:
$name
Returns:
bool|string

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1277 of file WebRequest.php.

Returns:
array

Reimplemented from WebRequest.

Definition at line 1246 of file WebRequest.php.

References wasPosted().

Here is the call graph for this function:

FauxRequest::getRawIP ( ) [protected]
Returns:
string

Definition at line 1332 of file WebRequest.php.

Return the path and query string portion of the request URI.

This will be suitable for use as a relative link in HTML output.

Returns:
String

Reimplemented from WebRequest.

Definition at line 1269 of file WebRequest.php.

References notImplemented().

Here is the call graph for this function:

Returns:
array|Mixed|null

Definition at line 1309 of file WebRequest.php.

Parameters:
$key
Returns:
mixed

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1293 of file WebRequest.php.

FauxRequest::getText ( name,
default = '' 
)
Parameters:
$namestring
$defaultstring
Returns:
string

Reimplemented from WebRequest.

Definition at line 1231 of file WebRequest.php.

References WebRequest\getVal().

Here is the call graph for this function:

Returns:
Array

Reimplemented from WebRequest.

Definition at line 1239 of file WebRequest.php.

FauxRequest::isPathInfoBad ( extWhitelist = array())
Parameters:
array$extWhitelist
Returns:
bool

Definition at line 1317 of file WebRequest.php.

FauxRequest::notImplemented ( method) [private]
Parameters:
$methodstring
Exceptions:
MWException

Definition at line 1222 of file WebRequest.php.

Referenced by getRequestURL().

Here is the caller graph for this function:

FauxRequest::setHeader ( name,
val 
)
Parameters:
$namestring
$valstring

Definition at line 1285 of file WebRequest.php.

FauxRequest::setSessionData ( key,
data 
)
Parameters:
$key
$data

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1302 of file WebRequest.php.

References WebRequest\$data.

Returns:
bool

Reimplemented from WebRequest.

Definition at line 1257 of file WebRequest.php.

Referenced by __construct(), and getQueryValues().

Here is the caller graph for this function:


Member Data Documentation

FauxRequest::$session = array() [private]

Definition at line 1199 of file WebRequest.php.

Referenced by __construct().

FauxRequest::$wasPosted = false [private]

Definition at line 1198 of file WebRequest.php.

Referenced by __construct(), and DerivativeRequest\__construct().


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