Back out r41001 for the moment ("Add log_user_text. Useful for log dumps, which are...
[lhc/web/wiklou.git] / maintenance / rebuildall.php
index 91f5492..ca7e4c0 100644 (file)
@@ -2,9 +2,10 @@
 /**
  * Rebuild link tracking tables from scratch.  This takes several
  * hours, depending on the database size and server configuration.
+ *
+ * @file
  * @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @ingroup Maintenance
  */
 
 /** */
@@ -15,25 +16,27 @@ require_once( "refreshLinks.inc" );
 require_once( "rebuildtextindex.inc" );
 require_once( "rebuildrecentchanges.inc" );
 
-$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+$dbclass = 'Database' . ucfirst( $wgDBtype ) ;
+$database = new $dbclass( $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 );
+if ($wgDBtype == 'mysql') {
+       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();
+rebuildRecentChangesTable();
 
 # Doesn't work anymore
 # rebuildLinkTables();
 
 # Use the slow incomplete one instead. It's designed to work in the background
-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";
+print "\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";
 refreshLinks( 1 );
 
 print "Done.\n";
 exit();
 
-?>
+