MediaWiki  REL1_19
DerivativeRequest Class Reference

Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base request for the remaining stuff (cookies, session and headers). More...

Inheritance diagram for DerivativeRequest:
Collaboration diagram for DerivativeRequest:

List of all members.

Public Member Functions

 __construct (WebRequest $base, $data, $wasPosted=false)
 checkSessionCookie ()
 Returns true if there is a session cookie set.
 getAcceptLang ()
 getAllHeaders ()
 Get an array containing all request headers.
 getCookie ($key, $prefix=null, $default=null)
 Get a cookie from the $_COOKIE jar.
 getHeader ($name)
 getIP ()
 getSessionData ($key)
 setSessionData ($key, $data)

Private Attributes

 $base

Detailed Description

Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base request for the remaining stuff (cookies, session and headers).

Definition at line 1344 of file WebRequest.php.


Constructor & Destructor Documentation

DerivativeRequest::__construct ( WebRequest base,
data,
wasPosted = false 
)

Definition at line 1347 of file WebRequest.php.

References $base, WebRequest\$data, FauxRequest\$wasPosted, and WebRequest\__construct().

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 FauxRequest.

Definition at line 1356 of file WebRequest.php.

Definition at line 1376 of file WebRequest.php.

Get an array containing all request headers.

Returns:
Array mapping header name to its value

Reimplemented from WebRequest.

Definition at line 1364 of file WebRequest.php.

DerivativeRequest::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 FauxRequest.

Definition at line 1352 of file WebRequest.php.

Parameters:
$name
Returns:
bool|string

Reimplemented from FauxRequest.

Definition at line 1360 of file WebRequest.php.

Definition at line 1380 of file WebRequest.php.

Parameters:
$key
Returns:
mixed

Reimplemented from FauxRequest.

Definition at line 1368 of file WebRequest.php.

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

Reimplemented from FauxRequest.

Definition at line 1372 of file WebRequest.php.

References WebRequest\$data.


Member Data Documentation

DerivativeRequest::$base [private]

Definition at line 1345 of file WebRequest.php.

Referenced by __construct().


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