Remove PHP4 "support" from using constant in update.php
[lhc/web/wiklou.git] / maintenance / update.php
index 182a2c4..b8af5e9 100755 (executable)
@@ -63,8 +63,7 @@ class UpdateMediaWiki extends Maintenance {
        }
 
        function getDbType() {
-               /* If we used the class constant PHP4 would give a parser error here */
-               return 2; /* Maintenance::DB_ADMIN */
+               return Maintenance::DB_ADMIN;
        }
 
        function compatChecks() {
@@ -126,7 +125,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $this->output( "MediaWiki {$wgVersion} Updater\n\n" );
 
-               wfWaitForSlaves( 5 ); // let's not kill databases, shall we? ;) --tor
+               wfWaitForSlaves();
 
                if ( !$this->hasOption( 'skip-compat-checks' ) ) {
                        $this->compatChecks();
@@ -151,7 +150,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $this->output( "Going to run database updates for " . wfWikiID() . "\n" );
                if ( $db->getType() === 'sqlite' ) {
-                       $this->output( "Using SQLite file: '{$db->mDatabaseFile}'\n" );
+                       $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" );
                }
                $this->output( "Depending on the size of your database this may take a while!\n" );
 
@@ -161,7 +160,7 @@ class UpdateMediaWiki extends Maintenance {
                        wfCountDown( 5 );
                }
 
-               $time1 = new MWTimestamp();
+               $time1 = microtime( true );
 
                $shared = $this->hasOption( 'doshared' );
 
@@ -197,9 +196,10 @@ class UpdateMediaWiki extends Maintenance {
                        $updater->purgeCache();
                }
 
-               $time2 = new MWTimestamp();
-               $timeDiff = $time2->diff( $time1 );
-               $this->output( "\nDone in " . $timeDiff->format( "%i:%S" ) . ".\n" );
+               $time2 = microtime( true );
+
+               $timeDiff = $wgLang->formatTimePeriod( $time2 - $time1 );
+               $this->output( "\nDone in $timeDiff.\n" );
        }
 
        function afterFinalSetup() {