MediaWiki  1.27.2
FauxResponse Class Reference
Inheritance diagram for FauxResponse:
Collaboration diagram for FauxResponse:

Public Member Functions

 getCookie ($name)
 
 getCookieData ($name)
 
 getCookies ()
 
 getHeader ($key)
 
 getStatusCode ()
 Get the HTTP response code, null if not set. More...
 
 header ($string, $replace=true, $http_response_code=null)
 Stores a HTTP header. More...
 
 headersSent ()
 
 setCookie ($name, $value, $expire=0, $options=[])
 
 statusHeader ($code)
 
- Public Member Functions inherited from WebResponse
 clearCookie ($name, $options=[])
 Unset a browser cookie. More...
 
 getHeader ($key)
 Get a response header. More...
 
 hasCookies ()
 Checks whether this request is performing cookie operations. More...
 
 header ($string, $replace=true, $http_response_code=null)
 Output an HTTP header, wrapper for PHP's header() More...
 
 headersSent ()
 Test if headers have been sent. More...
 
 setCookie ($name, $value, $expire=0, $options=[])
 Set the browser cookie. More...
 
 statusHeader ($code)
 Output an HTTP status code header. More...
 

Private Attributes

 $code
 
 $cookies = []
 
 $headers
 

Additional Inherited Members

- Static Protected Attributes inherited from WebResponse
static array $setCookies = []
 Used to record set cookies, because PHP's setcookie() will happily send an identical Set-Cookie to the client. More...
 

Detailed Description

Definition at line 197 of file WebResponse.php.

Member Function Documentation

FauxResponse::getCookie (   $name)
Parameters
string$name
Returns
string|null

Definition at line 313 of file WebResponse.php.

References $name, and cookies.

FauxResponse::getCookieData (   $name)
Parameters
string$name
Returns
array|null

Definition at line 324 of file WebResponse.php.

References $name, and cookies.

FauxResponse::getCookies ( )
Returns
array

Definition at line 334 of file WebResponse.php.

References $cookies.

FauxResponse::getHeader (   $key)
Parameters
string$keyThe name of the header to get (case insensitive).
Returns
string|null The header value (if set); null otherwise.

Definition at line 243 of file WebResponse.php.

References $key, and headers.

FauxResponse::getStatusCode ( )

Get the HTTP response code, null if not set.

Returns
int|null

Definition at line 257 of file WebResponse.php.

References $code.

FauxResponse::header (   $string,
  $replace = true,
  $http_response_code = null 
)

Stores a HTTP header.

Parameters
string$stringHeader to output
bool$replaceReplace current similar header
null | int$http_response_codeForces the HTTP response code to the specified value.

Definition at line 208 of file WebResponse.php.

References $key, code, headers, and list.

FauxResponse::headersSent ( )

Definition at line 235 of file WebResponse.php.

FauxResponse::setCookie (   $name,
  $value,
  $expire = 0,
  $options = [] 
)
Parameters
string$nameThe name of the cookie.
string$valueThe value to be stored in the cookie.
int | null$expireIgnored in this faux subclass.
array$optionsIgnored in this faux subclass.

Definition at line 267 of file WebResponse.php.

References $name, $options, $value, $wgCookiePrefix, cookies, global, and string.

FauxResponse::statusHeader (   $code)
Since
1.26
Parameters
int$codeStatus code

Definition at line 231 of file WebResponse.php.

References $code, and code.

Member Data Documentation

FauxResponse::$code
private

Definition at line 200 of file WebResponse.php.

Referenced by getStatusCode(), and statusHeader().

FauxResponse::$cookies = []
private

Definition at line 199 of file WebResponse.php.

Referenced by getCookies().

FauxResponse::$headers
private

Definition at line 198 of file WebResponse.php.


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