update.php: Correctly report durations >= 1 hour
authorKevin Israel <pleasestand@live.com>
Mon, 26 May 2014 15:02:45 +0000 (11:02 -0400)
committerKevin Israel <pleasestand@live.com>
Wed, 8 Apr 2015 01:24:22 +0000 (21:24 -0400)
Bug: T67772
Change-Id: I61492a1ad8bf7f574b198af82799b030221bb58b

maintenance/update.php

index 6e93011..0fd1fd8 100755 (executable)
@@ -161,7 +161,7 @@ class UpdateMediaWiki extends Maintenance {
                        wfCountDown( 5 );
                }
 
-               $time1 = new MWTimestamp();
+               $time1 = microtime( true );
 
                $shared = $this->hasOption( 'doshared' );
 
@@ -197,9 +197,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() {