MediaWiki  REL1_24
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, $protocol= 'http')
 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)
 getMethod ()
 Get the HTTP method used for this request.
 getProtocol ()
 Get the current URL protocol (http or https)
 getQueryValues ()
 getRawInput ()
 FauxRequests shouldn't depend on raw request data (but that could be implemented here)
 getRawPostString ()
 FauxRequests shouldn't depend on raw request data (but that could be implemented here)
 getRawQueryString ()
 FauxRequests shouldn't depend on raw request data (but that could be implemented here)
 getRequestURL ()
 Return the path and query string portion of the request URI.
 getSessionArray ()
 getSessionData ($key)
 getText ($name, $default= '')
 getValues ()
 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 1252 of file WebRequest.php.


Constructor & Destructor Documentation

FauxRequest::__construct ( data = array(),
wasPosted = false,
session = null,
protocol = 'http' 
)
Parameters:
array$dataArray of *non*-urlencoded key => value pairs, the fake GET/POST values
bool$wasPostedWhether to treat the data as POST
array | null$sessionSession array or null
string$protocol'http' or 'https'
Exceptions:
MWException

Definition at line 1264 of file WebRequest.php.


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

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1330 of file WebRequest.php.

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

Reimplemented from WebRequest.

Definition at line 1414 of file WebRequest.php.

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

Get a cookie from the $_COOKIE jar.

Parameters:
string$keyThe name of the cookie
string$prefixA prefix to use for the cookie name, if not $wgCookiePrefix
mixed$defaultWhat 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 1326 of file WebRequest.php.

Parameters:
string$nameThe name of the header to get (case insensitive).
Returns:
bool|string

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1346 of file WebRequest.php.

Get the HTTP method used for this request.

Returns:
string

Reimplemented from WebRequest.

Definition at line 1315 of file WebRequest.php.

Get the current URL protocol (http or https)

Returns:
string

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1338 of file WebRequest.php.

Returns:
array

Reimplemented from WebRequest.

Definition at line 1307 of file WebRequest.php.

FauxRequests shouldn't depend on raw request data (but that could be implemented here)

Returns:
string

Reimplemented from WebRequest.

Definition at line 1406 of file WebRequest.php.

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

Definition at line 1421 of file WebRequest.php.

FauxRequests shouldn't depend on raw request data (but that could be implemented here)

Returns:
string

Reimplemented from WebRequest.

Definition at line 1398 of file WebRequest.php.

FauxRequests shouldn't depend on raw request data (but that could be implemented here)

Returns:
string

Reimplemented from WebRequest.

Definition at line 1390 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.

Exceptions:
MWException
Returns:
string

Reimplemented from WebRequest.

Definition at line 1334 of file WebRequest.php.

Returns:
array|mixed|null

Definition at line 1382 of file WebRequest.php.

Parameters:
string$key
Returns:
array|null

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1364 of file WebRequest.php.

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

Reimplemented from WebRequest.

Definition at line 1292 of file WebRequest.php.

Returns:
array

Reimplemented from WebRequest.

Definition at line 1300 of file WebRequest.php.

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

Definition at line 1283 of file WebRequest.php.

FauxRequest::setHeader ( name,
val 
)
Parameters:
string$name
string$val

Definition at line 1355 of file WebRequest.php.

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

Reimplemented from WebRequest.

Reimplemented in DerivativeRequest.

Definition at line 1375 of file WebRequest.php.

Returns:
bool

Reimplemented from WebRequest.

Definition at line 1322 of file WebRequest.php.


Member Data Documentation

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

Definition at line 1254 of file WebRequest.php.

FauxRequest::$wasPosted = false [private]

Definition at line 1253 of file WebRequest.php.


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