From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/profiler/ProfilerSimpleTrace.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'includes/profiler/ProfilerSimpleTrace.php') diff --git a/includes/profiler/ProfilerSimpleTrace.php b/includes/profiler/ProfilerSimpleTrace.php index 822e9fe4..d44dfe1b 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,7 @@ 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"; } } @@ -69,6 +69,14 @@ class ProfilerSimpleTrace extends ProfilerSimple { } function logData() { - print ""; + if ( PHP_SAPI === 'cli' ) { + print ""; + } elseif ( $this->getContentType() === 'text/html' ) { + print ""; + } elseif ( $this->getContentType() === 'text/javascript' ) { + print "\n/*\n {$this->trace}\n*/"; + } elseif ( $this->getContentType() === 'text/css' ) { + print "\n/*\n {$this->trace}\n*/"; + } } } -- cgit v1.2.3-54-g00ecf