whitespace consistency
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index dc8bd10..6fed4aa 100644 (file)
@@ -3,17 +3,24 @@
  * Rebuild search index table from scratch.  This takes several
  * hours, depending on the database size and server configuration.
  *
+ * This is only for MySQL (see bug 9905). For postgres we can probably
+ * use SearchPostgres::update($pageid);
+ *
  * @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @addtogroup Maintenance
  */
 
 /** */
 require_once( "commandLine.inc" );
 require_once( "rebuildtextindex.inc" );
-$wgTitle = Title::newFromText( "Rebuild text index script" );
 
-$database = Database::newFromParams( $wgDBserver, $wgDBport, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+$database = wfGetDB( DB_MASTER );
+if( !$database instanceof DatabaseMysql ) {
+       print "This script is only for MySQL.\n";
+       exit();
+}
+
+$wgTitle = Title::newFromText( "Rebuild text index script" );
 
 dropTextIndex( $database );
 rebuildTextIndex( $database );