Basic multiprocess operation via pcntl_fork()
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index 247fedc..73dca87 100644 (file)
@@ -1,12 +1,27 @@
 <?php
-# Rebuild search index table from scratch.  This takes several
-# hours, depending on the database size and server configuration.
+/**
+ * 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).
+ * Postgres is trigger-based and should never need rebuilding.
+ *
+ * @file
+ * @todo document
+ * @ingroup Maintenance
+ */
 
+/** */
 require_once( "commandLine.inc" );
 require_once( "rebuildtextindex.inc" );
-$wgTitle = Title::newFromText( "Rebuild text index script" );
 
-$database = Database::newFromParams( $wgDBserver, $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 );
@@ -15,4 +30,4 @@ createTextIndex( $database );
 print "Done.\n";
 exit();
 
-?>
+