MediaWiki  REL1_22
rebuildmessages.php
Go to the documentation of this file.
00001 <?php
00024 require_once __DIR__ . '/Maintenance.php';
00025 
00031 class RebuildMessages extends Maintenance {
00032     public function __construct() {
00033         parent::__construct();
00034         $this->mDescription = "Purge all language messages from the cache";
00035     }
00036 
00037     public function execute() {
00038         global $wgLocalDatabases, $wgDBname, $wgEnableSidebarCache, $messageMemc;
00039         if ( $wgLocalDatabases ) {
00040             $databases = $wgLocalDatabases;
00041         } else {
00042             $databases = array( $wgDBname );
00043         }
00044 
00045         foreach ( $databases as $db ) {
00046             $this->output( "Deleting message cache for {$db}... " );
00047             $messageMemc->delete( "{$db}:messages" );
00048             if ( $wgEnableSidebarCache ) {
00049                 $messageMemc->delete( "{$db}:sidebar" );
00050             }
00051             $this->output( "Deleted\n" );
00052         }
00053     }
00054 }
00055 
00056 $maintClass = "RebuildMessages";
00057 require_once RUN_MAINTENANCE_IF_MAIN;