X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Frebuildall.php;h=dbbed86d256dbc938e5f598ac24f0a07bb9843d7;hb=6564620d2ad94ac502ea3b5a45951173e11cca05;hp=7b556264aac749faf0586f8460cb5a6c2a0b630c;hpb=04e6adebb8fefe85cfd3c017d3e84e4f24b82f50;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index 7b556264aa..dbbed86d25 100644 --- a/maintenance/rebuildall.php +++ b/maintenance/rebuildall.php @@ -1,43 +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"; -include_once( "../LocalSettings.php" ); -include_once( "../AdminSettings.php" ); - -$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":"; -ini_set( "include_path", "$IP$sep$include_path" ); - -include_once( "Setup.php" ); -include_once( "./rebuildlinks.inc" ); -include_once( "./rebuildtextindex.inc" ); -include_once( "./rebuildrecentchanges.inc" ); -$wgTitle = Title::newFromText( "Rebuild links script" ); -set_time_limit(0); - -$wgDBuser = $wgDBadminuser; -$wgDBpassword = $wgDBadminpassword; - -rebuildLinkTablesPass1(); -rebuildLinkTablesPass2(); - -dropTextIndex(); -rebuildTextIndex(); -createTextIndex(); - -rebuildRecentChangesTablePass1(); -rebuildRecentChangesTablePass2(); - -print "Done.\n"; -exit(); - -?> +$maintClass = "RebuildAll"; +require_once( RUN_MAINTENANCE_IF_MAIN );