summaryrefslogtreecommitdiff
path: root/maintenance/rebuildall.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/rebuildall.php')
-rw-r--r--maintenance/rebuildall.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php
index 1c2647b2..ca7e4c06 100644
--- a/maintenance/rebuildall.php
+++ b/maintenance/rebuildall.php
@@ -2,8 +2,10 @@
/**
* Rebuild link tracking tables from scratch. This takes several
* hours, depending on the database size and server configuration.
+ *
+ * @file
* @todo document
- * @addtogroup Maintenance
+ * @ingroup Maintenance
*/
/** */
@@ -14,12 +16,15 @@ 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";
rebuildRecentChangesTable();