MediaWiki
1.23.2
|
Allow programs to request this object from WebRequest::response() and handle all outputting (or lack of outputting) via it. More...
Public Member Functions | |
header ( $string, $replace=true, $http_response_code=null) | |
Output a HTTP header, wrapper for PHP's header() More... | |
setcookie ( $name, $value, $expire=0, $options=null) | |
Set the browser cookie. More... | |
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.
WebResponse::header | ( | $string, | |
$replace = true , |
|||
$http_response_code = null |
|||
) |
Output a HTTP header, wrapper for PHP's header()
string | $string | header to output |
bool | $replace | replace current similar header |
null | int | $http_response_code | Forces the HTTP response code to the specified value. |
Reimplemented in FauxResponse.
Definition at line 36 of file WebResponse.php.
WebResponse::setcookie | ( | $name, | |
$value, | |||
$expire = 0 , |
|||
$options = null |
|||
) |
Set the browser cookie.
string | $name | name of cookie |
string | $value | value to give cookie |
int | null | $expire | Unix 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 | $options | Assoc 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' |
Reimplemented in FauxResponse.
Definition at line 59 of file WebResponse.php.
References $name, $options, $value, $wgCookiePrefix, array(), global, wfDebugLog(), and wfRunHooks().