X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fprofiler%2FProfilerSimpleTrace.php;h=5588d1e2cbdcf3f168595430ad0196018b372706;hb=62e3c203c5b834a29b40c846898ee99b79fdeb86;hp=017e13524876d2f36ef4b77a56525a2792f06033;hpb=78f603d87c65fd5c3a063b5025d6c94d4b2f77f0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/profiler/ProfilerSimpleTrace.php b/includes/profiler/ProfilerSimpleTrace.php index 017e135248..5588d1e2cb 100644 --- a/includes/profiler/ProfilerSimpleTrace.php +++ b/includes/profiler/ProfilerSimpleTrace.php @@ -32,18 +32,18 @@ class ProfilerSimpleTrace extends ProfilerSimple { function profileIn( $functionname ) { parent::profileIn( $functionname ); - $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) { + function profileOut( $functionname ) { global $wgDebugFunctionEntry; if ( $wgDebugFunctionEntry ) { - $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); + $this->debug( str_repeat( ' ', count( $this->mWorkStack ) - 1 ) . 'Exiting ' . $functionname . "\n" ); } - list( $ofname, /* $ocount */ , $ortime ) = array_pop( $this->mWorkStack ); + list( $ofname, /* $ocount */, $ortime ) = array_pop( $this->mWorkStack ); if ( !$ofname ) { $this->trace .= "Profiling error: $functionname\n"; @@ -58,7 +58,9 @@ class ProfilerSimpleTrace extends ProfilerSimple { } $elapsedreal = $this->getTime() - $ortime; $this->trace .= sprintf( "%03.6f %6.1f", $elapsedreal, $this->memoryDiff() ) . - str_repeat(" ", count( $this->mWorkStack ) + 1 ) . " < " . $functionname . "\n"; + str_repeat( " ", count( $this->mWorkStack ) + 1 ) . " < " . $functionname . "\n"; + + $this->updateTrxProfiling( $functionname, $elapsedreal ); } } @@ -69,7 +71,7 @@ class ProfilerSimpleTrace extends ProfilerSimple { } function logData() { - if ( php_sapi_name() === 'cli' ) { + if ( PHP_SAPI === 'cli' ) { print ""; } elseif ( $this->getContentType() === 'text/html' ) { print "";