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