Add new message keys to go with r105954
[lhc/web/wiklou.git] / maintenance / rebuildall.php
index 4d743e6..dbbed86 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class RebuildAll extends Maintenance {
        public function __construct() {
@@ -30,27 +30,26 @@ class RebuildAll extends Maintenance {
        }
 
        public function execute() {
-               global $wgDBtype;
                // Rebuild the text index
-               if ( $wgDBtype == 'mysql' ) {
+               if ( wfGetDB( DB_SLAVE )->getType() != 'postgres' ) {
                        $this->output( "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n" );
-                       $rebuildText = $this->spawnChild( 'RebuildTextIndex', 'rebuildtextindex.php' );
+                       $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' );
                        $rebuildText->execute();
                }
 
                // Rebuild RC
                $this->output( "\n\n** Rebuilding recentchanges table:\n" );
-               $rebuildRC = $this->spawnChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' );
+               $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' );
                $rebuildRC->execute();
 
                // Rebuild link tables
                $this->output( "\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" );
-               $rebuildLinks = $this->spawnChild( 'RefreshLinks', 'refreshLinks.php' );
+               $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' );
                $rebuildLinks->execute();
-               
+
                $this->output( "Done.\n" );
        }
 }
 
 $maintClass = "RebuildAll";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );