MediaWiki  REL1_22
WebResponse Class Reference

Allow programs to request this object from WebRequest::response() and handle all outputting (or lack of outputting) via it. More...

Inheritance diagram for WebResponse:

List of all members.

Public Member Functions

 header ($string, $replace=true, $http_response_code=null)
 Output a HTTP header, wrapper for PHP's header()
 setcookie ($name, $value, $expire=0, $options=null)
 Set the browser cookie.

Detailed Description

Allow programs to request this object from WebRequest::response() and handle all outputting (or lack of outputting) via it.

Definition at line 28 of file WebResponse.php.


Member Function Documentation

WebResponse::header ( string,
replace = true,
http_response_code = null 
)

Output a HTTP header, wrapper for PHP's header()

Parameters:
string$stringheader to output
bool$replacereplace current similar header
$http_response_codenull|int Forces the HTTP response code to the specified value.

Reimplemented in FauxResponse.

Definition at line 37 of file WebResponse.php.

WebResponse::setcookie ( name,
value,
expire = 0,
options = null 
)

Set the browser cookie.

Parameters:
string$namename of cookie
string$valuevalue to give cookie
int | null$expireUnix timestamp (in seconds) when the cookie should expire. 0 (the default) causes it to expire $wgCookieExpiration seconds from now. null causes it to be a session cookie.
array$optionsAssoc of additional cookie options: prefix: string, name prefix ($wgCookiePrefix) domain: string, cookie domain ($wgCookieDomain) path: string, cookie path ($wgCookiePath) secure: bool, secure attribute ($wgCookieSecure) httpOnly: bool, httpOnly attribute ($wgCookieHttpOnly) raw: bool, if true uses PHP's setrawcookie() instead of setcookie() For backwards compatability, if $options is not an array then it and the following two parameters will be interpreted as values for 'prefix', 'domain', and 'secure'
Since:
1.22 Replaced $prefix, $domain, and $forceSecure with $options

Reimplemented in FauxResponse.

Definition at line 60 of file WebResponse.php.

References $name, $options, $value, $wgCookiePrefix, array(), global, wfDebugLog(), wfHttpOnlySafe(), and wfRunHooks().


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