From: Sam Reed Date: Tue, 30 Nov 2010 18:33:59 +0000 (+0000) Subject: Remove a couple of unused variables, add spaces, wrap some long lines X-Git-Tag: 1.31.0-rc.0~33677 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=cac51500b5eb9565ae1d59007d626570265f7418;p=lhc%2Fweb%2Fwiklou.git Remove a couple of unused variables, add spaces, wrap some long lines --- diff --git a/includes/ProfilerSimpleTrace.php b/includes/ProfilerSimpleTrace.php index 8d1a0d81ba..8f6a2a1ca6 100644 --- a/includes/ProfilerSimpleTrace.php +++ b/includes/ProfilerSimpleTrace.php @@ -21,49 +21,48 @@ class ProfilerSimpleTrace extends ProfilerSimple { function __construct() { global $wgRequestTime, $wgRUstart; - if (!empty($wgRequestTime) && !empty($wgRUstart)) { - $this->mWorkStack[] = array( '-total', 0, $wgRequestTime,$this->getCpuTime($wgRUstart)); - $elapsedcpu = $this->getCpuTime() - $this->getCpuTime($wgRUstart); - $elapsedreal = microtime(true) - $wgRequestTime; + if ( !empty( $wgRequestTime ) && !empty( $wgRUstart ) ) { + $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, $this->getCpuTime( $wgRUstart ) ); } $this->trace .= "Beginning trace: \n"; } function profileIn($functionname) { $this->mWorkStack[] = array($functionname, count( $this->mWorkStack ), microtime(true), $this->getCpuTime()); - $this->trace .= " " . sprintf("%6.1f",$this->memoryDiff()) . str_repeat( " ", count($this->mWorkStack)) . " > " . $functionname . "\n"; + $this->trace .= " " . sprintf("%6.1f",$this->memoryDiff()) . + str_repeat( " ", count($this->mWorkStack)) . " > " . $functionname . "\n"; } function profileOut($functionname) { global $wgDebugFunctionEntry; - if ($wgDebugFunctionEntry) { + if ( $wgDebugFunctionEntry ) { $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); } - list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack); + list( $ofname, /* $ocount */ , $ortime, $octime ) = array_pop( $this->mWorkStack ); - if (!$ofname) { + if ( !$ofname ) { $this->trace .= "Profiling error: $functionname\n"; } else { - if ($functionname == 'close') { + if ( $functionname == 'close' ) { $message = "Profile section ended by close(): {$ofname}"; $functionname = $ofname; $this->trace .= $message . "\n"; } - elseif ($ofname != $functionname) { + elseif ( $ofname != $functionname ) { $this->trace .= "Profiling error: in({$ofname}), out($functionname)"; } - $elapsedcpu = $this->getCpuTime() - $octime; - $elapsedreal = microtime(true) - $ortime; - $this->trace .= sprintf("%03.6f %6.1f",$elapsedreal,$this->memoryDiff()) . str_repeat(" ",count($this->mWorkStack)+1) . " < " . $functionname . "\n"; + $elapsedreal = microtime( true ) - $ortime; + $this->trace .= sprintf( "%03.6f %6.1f", $elapsedreal, $this->memoryDiff() ) . + str_repeat(" ", count( $this->mWorkStack ) + 1 ) . " < " . $functionname . "\n"; } } function memoryDiff() { $diff = memory_get_usage() - $this->memory; $this->memory = memory_get_usage(); - return $diff/1024; + return $diff / 1024; } function getOutput() {