Fix some of the rebuild scripts
[lhc/web/wiklou.git] / maintenance / rebuildall.php
index d9ec307..670f560 100644 (file)
@@ -10,21 +10,23 @@ require_once( "refreshlinks.inc" );
 require_once( "rebuildtextindex.inc" );
 require_once( "rebuildrecentchanges.inc" );
 
-$wgDBuser                      = $wgDBadminuser;
-$wgDBpassword          = $wgDBadminpassword;
+$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+
+print "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n";
+dropTextIndex( $database );
+rebuildTextIndex( $database );
+createTextIndex( $database );
+
+print "\n\n** Rebuilding recentchanges table:\n";
+rebuildRecentChangesTablePass1();
+rebuildRecentChangesTablePass2();
 
 # Doesn't work anymore
 # rebuildLinkTables();
 
 # Use the slow incomplete one instead. It's designed to work in the background
-#refreshLinks( 1 );
-
-dropTextIndex();
-rebuildTextIndex();
-createTextIndex();
-
-rebuildRecentChangesTablePass1();
-rebuildRecentChangesTablePass2();
+print "\n\n** Rebuilding links tables -- this can take a long time. It should be safe to about via ctrl+C if you get bored.\n";
+refreshLinks( 1 );
 
 print "Done.\n";
 exit();