MediaWiki  master
rebuildmessages.php
Go to the documentation of this file.
1 <?php
23 
24 require_once __DIR__ . '/Maintenance.php';
25 
32  public function __construct() {
33  parent::__construct();
34  $this->addDescription( 'Purge the MessageCache for all interface languages.' );
35  }
36 
37  public function execute() {
38  $this->output( "Purging message cache for all languages on this wiki... " );
39  $messageCache = MediaWikiServices::getInstance()->getMessageCache();
40  $messageCache->clear();
41  $this->output( "Done\n" );
42  }
43 }
44 
45 $maintClass = RebuildMessages::class;
46 require_once RUN_MAINTENANCE_IF_MAIN;
RUN_MAINTENANCE_IF_MAIN
const RUN_MAINTENANCE_IF_MAIN
Definition: Maintenance.php:39
RebuildMessages\__construct
__construct()
Default constructor.
Definition: rebuildmessages.php:32
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:129
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:352
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:86
$maintClass
$maintClass
Definition: rebuildmessages.php:45
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:457
RebuildMessages
Maintenance script that purges cache used by MessageCache.
Definition: rebuildmessages.php:31
RebuildMessages\execute
execute()
Do the actual work.
Definition: rebuildmessages.php:37