48 self::$disableForPostSend =
true;
57 public function header( $string, $replace =
true, $http_response_code =
null ) {
58 if ( self::$disableForPostSend ) {
59 wfDebugLog(
'header',
'ignored post-send header {header}',
'all', [
61 'replace' => $replace,
62 'http_response_code' => $http_response_code,
63 'exception' =>
new RuntimeException(
'Ignored post-send header' ),
68 \MediaWiki\HeaderCallback::warnIfHeadersSent();
69 if ( $http_response_code ) {
70 header( $string, $replace, $http_response_code );
72 header( $string, $replace );
98 if ( self::$disableForPostSend ) {
99 wfDebugLog(
'header',
'ignored post-send status header {code}',
'all', [
101 'exception' =>
new RuntimeException(
'Ignored post-send status header' ),
148 if ( $expire ===
null ) {
154 if ( self::$disableForPostSend ) {
156 wfDebugLog(
'cookie',
'ignored post-send cookie {cookie}',
'all', [
159 'name' => (
string)$cookie,
160 'value' => (
string)
$value,
161 'expire' => (
int)$expire,
163 'domain' => (
string)
$options[
'domain'],
164 'secure' => (
bool)
$options[
'secure'],
165 'httpOnly' => (
bool)
$options[
'httpOnly'],
167 'exception' =>
new RuntimeException(
'Ignored post-send cookie' ),
172 $func =
$options[
'raw'] ?
'setrawcookie' :
'setcookie';
174 if ( Hooks::run(
'WebResponseSetCookie', [ &$name, &
$value, &$expire, &
$options ] ) ) {
179 'name' => (
string)$cookie,
180 'value' => (
string)
$value,
181 'expire' => (
int)$expire,
184 'secure' => (
bool)
$options[
'secure'],
189 $key =
"{$data['name']}\n{$data['domain']}\n{$data['path']}";
194 self::$setCookies[$key] = [];
198 $deleting = (
$data[
'value'] ===
'' ||
$data[
'expire'] > 0 &&
$data[
'expire'] <= time() );
200 if ( $deleting && !
isset( self::$setCookies[$key] ) ) {
201 wfDebugLog(
'cookie',
'already deleted ' . $func .
': "' . implode(
'", "',
$data ) .
'"' );
202 }
elseif ( !$deleting &&
isset( self::$setCookies[$key] ) &&
203 self::$setCookies[$key] === [ $func,
$data ]
205 wfDebugLog(
'cookie',
'already set ' . $func .
': "' . implode(
'", "',
$data ) .
'"' );
207 wfDebugLog(
'cookie', $func .
': "' . implode(
'", "',
$data ) .
'"' );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgCookieExpiration
Default cookie lifetime, in seconds.
$wgCookieHttpOnly
Set authentication cookies to HttpOnly to prevent access by JavaScript, in browsers that support this...
$wgCookiePath
Set this variable if you want to restrict cookies to a certain path within the domain specified by $w...
$wgCookieDomain
Set to set an explicit domain on the login cookies eg, "justthis.domain.org" or "....
$wgCookieSecure
Whether the "secure" flag should be set on the cookie.
$wgCookiePrefix
Cookies generated by MediaWiki have names starting with this prefix.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
static header( $code)
Output an HTTP status code header.
Allow programs to request this object from WebRequest::response() and handle all outputting (or lack ...
setCookie( $name, $value, $expire=0, $options=[])
Set the browser cookie.
hasCookies()
Checks whether this request is performing cookie operations.
static bool $disableForPostSend
Used to disable setters before running jobs post-request (T191537)
getHeader( $key)
Get a response header.
statusHeader( $code)
Output an HTTP status code header.
static disableForPostSend()
Disable setters for post-send processing.
header( $string, $replace=true, $http_response_code=null)
Output an HTTP header, wrapper for PHP's header()
clearCookie( $name, $options=[])
Unset a browser cookie.
headersSent()
Test if headers have been sent.
static array $setCookies
Used to record set cookies, because PHP's setcookie() will happily send an identical Set-Cookie to th...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Allows to change the fields on the form that will be generated $name
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))