MediaWiki  REL1_24
rebuildall.php
Go to the documentation of this file.
00001 <?php
00025 require_once __DIR__ . '/Maintenance.php';
00026 
00032 class RebuildAll extends Maintenance {
00033     public function __construct() {
00034         parent::__construct();
00035         $this->mDescription = "Rebuild links, text index and recent changes";
00036     }
00037 
00038     public function getDbType() {
00039         return Maintenance::DB_ADMIN;
00040     }
00041 
00042     public function execute() {
00043         // Rebuild the text index
00044         if ( wfGetDB( DB_SLAVE )->getType() != 'postgres' ) {
00045             $this->output( "** Rebuilding fulltext search index (if you abort "
00046                 . "this will break searching; run this script again to fix):\n" );
00047             $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' );
00048             $rebuildText->execute();
00049         }
00050 
00051         // Rebuild RC
00052         $this->output( "\n\n** Rebuilding recentchanges table:\n" );
00053         $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' );
00054         $rebuildRC->execute();
00055 
00056         // Rebuild link tables
00057         $this->output( "\n\n** Rebuilding links tables -- this can take a long time. "
00058             . "It should be safe to abort via ctrl+C if you get bored.\n" );
00059         $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' );
00060         $rebuildLinks->execute();
00061 
00062         $this->output( "Done.\n" );
00063     }
00064 }
00065 
00066 $maintClass = "RebuildAll";
00067 require_once RUN_MAINTENANCE_IF_MAIN;