MediaWiki  master
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...
 
 hasCookies ()
 Checks whether this request is performing cookie operations.
Returns
bool
Since
1.27
More...
 
 header ( $string, $replace=true, $http_response_code=null)
 Stores a HTTP header. More...
 
 headersSent ()
 Test if headers have been sent. More...
 
 setCookie ( $name, $value, $expire=0, $options=[])
 
 setCookieConfig (Config $cookieConfig)
 
 statusHeader ( $code)
 
- Public Member Functions inherited from WebResponse
 clearCookie ( $name, $options=[])
 Unset a browser cookie. More...
 

Private Member Functions

 getCookieConfig ()
 

Private Attributes

 $code
 
Config $cookieConfig = null
 
 $cookies = []
 
 $headers
 

Additional Inherited Members

- Static Public Member Functions inherited from WebResponse
static disableForPostSend ()
 Disable setters for post-send processing. More...
 
- Static Protected Attributes inherited from WebResponse
static bool $disableForPostSend = false
 Used to disable setters before running jobs post-request (T191537) More...
 
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 30 of file FauxResponse.php.

Member Function Documentation

◆ getCookie()

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

Definition at line 157 of file FauxResponse.php.

◆ getCookieConfig()

FauxResponse::getCookieConfig ( )
private
Returns
Config

Definition at line 97 of file FauxResponse.php.

◆ getCookieData()

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

Definition at line 168 of file FauxResponse.php.

◆ getCookies()

FauxResponse::getCookies ( )
Returns
array[]

Definition at line 175 of file FauxResponse.php.

◆ getHeader()

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

Reimplemented from WebResponse.

Definition at line 79 of file FauxResponse.php.

◆ getStatusCode()

FauxResponse::getStatusCode ( )

Get the HTTP response code, null if not set.

Returns
int|null

Definition at line 90 of file FauxResponse.php.

References $code.

◆ hasCookies()

FauxResponse::hasCookies ( )

Checks whether this request is performing cookie operations.

Returns
bool
Since
1.27

Reimplemented from WebResponse.

Definition at line 182 of file FauxResponse.php.

◆ header()

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.

Reimplemented from WebResponse.

Definition at line 44 of file FauxResponse.php.

◆ headersSent()

FauxResponse::headersSent ( )

Test if headers have been sent.

Since
1.27
Returns
bool

Reimplemented from WebResponse.

Definition at line 71 of file FauxResponse.php.

◆ setCookie()

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.

Reimplemented from WebResponse.

Definition at line 117 of file FauxResponse.php.

◆ setCookieConfig()

FauxResponse::setCookieConfig ( Config  $cookieConfig)
Parameters
Config$cookieConfig

Definition at line 107 of file FauxResponse.php.

◆ statusHeader()

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

Reimplemented from WebResponse.

Definition at line 67 of file FauxResponse.php.

References $code.

Member Data Documentation

◆ $code

FauxResponse::$code
private

Definition at line 33 of file FauxResponse.php.

Referenced by getStatusCode(), and statusHeader().

◆ $cookieConfig

Config FauxResponse::$cookieConfig = null
private

Definition at line 36 of file FauxResponse.php.

◆ $cookies

FauxResponse::$cookies = []
private

Definition at line 32 of file FauxResponse.php.

◆ $headers

FauxResponse::$headers
private

Definition at line 31 of file FauxResponse.php.


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