X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Frebuildall.php;h=3d2aebc4bf24df6fdfe2744eac08246b1d418d9c;hb=f34df0002215d8773f80ec68045c680d2363d151;hp=91aa1cee4b77f6c6148c7569c27a8676ca2b38ed;hpb=d90d721572bdfcab119822b4792b7cea0a32b0f4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index 91aa1cee4b..3d2aebc4bf 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"; -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; - -rebuildLinkTables(); - -dropTextIndex(); -rebuildTextIndex(); -createTextIndex(); - -rebuildRecentChangesTablePass1(); -rebuildRecentChangesTablePass2(); - -print "Done.\n"; -exit(); - -?> +$maintClass = "RebuildAll"; +require_once( DO_MAINTENANCE );