<?php
-
-# Rebuild search index table from scratch. This takes several
-# hours, depending on the database size and server configuration.
-
-if ( ! is_readable( "../LocalSettings.php" ) ) {
- print "A copy of your installation's LocalSettings.php\n" .
- "must exist in the source directory.\n";
- exit();
-}
-
-$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( "./rebuildtextindex.inc" );
+/**
+ * Rebuild search index table from scratch. This takes several
+ * hours, depending on the database size and server configuration.
+ *
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
+require_once( "commandLine.inc" );
+require_once( "rebuildtextindex.inc" );
$wgTitle = Title::newFromText( "Rebuild text index script" );
-set_time_limit(0);
-$wgDBuser = $wgDBadminuser;
-$wgDBpassword = $wgDBadminpassword;
+$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
-dropTextIndex();
-rebuildTextIndex();
-createTextIndex();
+dropTextIndex( $database );
+rebuildTextIndex( $database );
+createTextIndex( $database );
print "Done.\n";
exit();