X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Frebuildall.php;h=dbbed86d256dbc938e5f598ac24f0a07bb9843d7;hb=337b0d3b0f94c74df341e57b6dfe355e09090129;hp=a9d0a976043098f48f48d035cb50f58c4bb03a4e;hpb=8f22cb45b1ccd2d18bb4ef1247a18efbb9a87e2d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index a9d0a97604..dbbed86d25 100644 --- a/maintenance/rebuildall.php +++ b/maintenance/rebuildall.php @@ -1,42 +1,55 @@ mDescription = "Rebuild links, text index and recent changes"; + } + + public function execute() { + // Rebuild the text index + if ( wfGetDB( DB_SLAVE )->getType() != 'postgres' ) { + $this->output( "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n" ); + $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' ); + $rebuildText->execute(); + } + + // Rebuild RC + $this->output( "\n\n** Rebuilding recentchanges table:\n" ); + $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' ); + $rebuildRC->execute(); + + // Rebuild link tables + $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" ); + $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' ); + $rebuildLinks->execute(); + + $this->output( "Done.\n" ); + } } -$wgCommandLineMode = true; -$DP = "../includes"; -require_once( "../LocalSettings.php" ); -require_once( "../AdminSettings.php" ); - -$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":"; -ini_set( "include_path", "$IP$sep$include_path" ); - -require_once( "Setup.php" ); -require_once( "./rebuildlinks.inc" ); -require_once( "./rebuildtextindex.inc" ); -require_once( "./rebuildrecentchanges.inc" ); -$wgTitle = Title::newFromText( "Rebuild links script" ); -set_time_limit(0); - -$wgDBuser = $wgDBadminuser; -$wgDBpassword = $wgDBadminpassword; - -rebuildLinkTables(); - -dropTextIndex(); -rebuildTextIndex(); -createTextIndex(); - -rebuildRecentChangesTablePass1(); -rebuildRecentChangesTablePass2(); - -print "Done.\n"; -exit(); - -?> +$maintClass = "RebuildAll"; +require_once( RUN_MAINTENANCE_IF_MAIN );