MediaWiki
REL1_33
rebuildmessages.php
Go to the documentation of this file.
1
<?php
24
require_once __DIR__ .
'/Maintenance.php'
;
25
31
class
RebuildMessages
extends
Maintenance
{
32
public
function
__construct
() {
33
parent::__construct();
34
$this->
addDescription
(
'Purge all language messages from the cache'
);
35
}
36
37
public
function
execute
() {
38
global
$wgLocalDatabases
,
$wgDBname
,
$wgEnableSidebarCache
,
$messageMemc
;
39
if
(
$wgLocalDatabases
) {
40
$databases =
$wgLocalDatabases
;
41
}
else
{
42
$databases = [
$wgDBname
];
43
}
44
45
foreach
( $databases as $db ) {
46
$this->
output
(
"Deleting message cache for {$db}... "
);
47
$messageMemc->delete(
"{$db}:messages"
);
48
if
(
$wgEnableSidebarCache
) {
49
$messageMemc
->delete(
"{$db}:sidebar"
);
50
}
51
$this->
output
(
"Deleted\n"
);
52
}
53
}
54
}
55
56
$maintClass
= RebuildMessages::class;
57
require_once
RUN_MAINTENANCE_IF_MAIN
;
$wgEnableSidebarCache
$wgEnableSidebarCache
If on, the sidebar navigation links are cached for users with the current language set.
Definition
DefaultSettings.php:2648
$wgLocalDatabases
string[] $wgLocalDatabases
Other wikis on this site, can be administered from a single developer account.
Definition
DefaultSettings.php:2161
$messageMemc
$messageMemc
Definition
Setup.php:769
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition
maintenance.txt:39
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition
Maintenance.php:434
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:329
RebuildMessages
Maintenance script that purges all languages from the message cache.
Definition
rebuildmessages.php:31
RebuildMessages\execute
execute()
Do the actual work.
Definition
rebuildmessages.php:37
RebuildMessages\__construct
__construct()
Default constructor.
Definition
rebuildmessages.php:32
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition
maintenance.txt:50
$wgDBname
controlled by the following MediaWiki still creates a BagOStuff but calls it to it are no ops If the cache daemon can t be it should also disable itself fairly $wgDBname
Definition
memcached.txt:135
$maintClass
$maintClass
Definition
rebuildmessages.php:56
maintenance
rebuildmessages.php
Generated on Mon Nov 25 2024 15:50:44 for MediaWiki by
1.10.0