MediaWiki  REL1_22
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 this will break searching; run this script again to fix):\n" );
00046             $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' );
00047             $rebuildText->execute();
00048         }
00049 
00050         // Rebuild RC
00051         $this->output( "\n\n** Rebuilding recentchanges table:\n" );
00052         $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' );
00053         $rebuildRC->execute();
00054 
00055         // Rebuild link tables
00056         $this->output( "\n\n** Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.\n" );
00057         $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' );
00058         $rebuildLinks->execute();
00059 
00060         $this->output( "Done.\n" );
00061     }
00062 }
00063 
00064 $maintClass = "RebuildAll";
00065 require_once RUN_MAINTENANCE_IF_MAIN;