From: Brion Vibber Date: Mon, 29 May 2006 05:29:27 +0000 (+0000) Subject: Fix microtime breakage X-Git-Tag: 1.31.0-rc.0~56981 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=469cc8686d49f163c30739ef947ed0cc98062828;p=lhc%2Fweb%2Fwiklou.git Fix microtime breakage --- diff --git a/config/index.php b/config/index.php index bebff030e7..7f5ba344b2 100644 --- a/config/index.php +++ b/config/index.php @@ -24,7 +24,7 @@ header( "Content-type: text/html; charset=utf-8" ); @ini_set( "display_errors", true ); # In case of errors, let output be clean. -$wgRequestTime = microtime(); +$wgRequestTime = microtime( true ); # Attempt to set up the include path, to fix problems with relative includes $IP = dirname( dirname( __FILE__ ) ); diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0a148e127a..f8ef126ace 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -249,11 +249,9 @@ function logProfilingData() { global $wgProfiling, $wgUser; $now = wfTime(); - list( $usec, $sec ) = explode( ' ', $wgRequestTime ); - $start = (float)$sec + (float)$usec; - $elapsed = $now - $start; + $elapsed = $now - $wgRequestTime; if ( $wgProfiling ) { - $prof = wfGetProfilingOutput( $start, $elapsed ); + $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed ); $forward = ''; if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR']; @@ -701,9 +699,7 @@ function wfHostname() { global $wgRequestTime; $now = wfTime(); - list( $usec, $sec ) = explode( ' ', $wgRequestTime ); - $start = (float)$sec + (float)$usec; - $elapsed = $now - $start; + $elapsed = $now - $wgRequestTime; $com = sprintf( "", wfHostname(), $elapsed );