summaryrefslogtreecommitdiff
path: root/includes/profiler/ProfilerSimple.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/profiler/ProfilerSimple.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/profiler/ProfilerSimple.php')
-rw-r--r--includes/profiler/ProfilerSimple.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/includes/profiler/ProfilerSimple.php b/includes/profiler/ProfilerSimple.php
index d1d1c5d9..1d4873c6 100644
--- a/includes/profiler/ProfilerSimple.php
+++ b/includes/profiler/ProfilerSimple.php
@@ -29,7 +29,7 @@
class ProfilerSimple extends Profiler {
var $mMinimumTime = 0;
- var $zeroEntry = array('cpu'=> 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0);
+ var $zeroEntry = array( 'cpu' => 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0 );
var $errorEntry;
public function isPersistent() {
@@ -57,33 +57,33 @@ class ProfilerSimple extends Profiler {
$this->mMinimumTime = $min;
}
- function profileIn($functionname) {
+ function profileIn( $functionname ) {
global $wgDebugFunctionEntry;
- if ($wgDebugFunctionEntry) {
- $this->debug(str_repeat(' ', count($this->mWorkStack)).'Entering '.$functionname."\n");
+ if ( $wgDebugFunctionEntry ) {
+ $this->debug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering ' . $functionname . "\n" );
}
$this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), $this->getTime( 'cpu' ) );
}
- function profileOut($functionname) {
+ function profileOut( $functionname ) {
global $wgDebugFunctionEntry;
- if ($wgDebugFunctionEntry) {
- $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n");
+ 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) {
- $this->debug("Profiling error: $functionname\n");
+ if ( !$ofname ) {
+ $this->debug( "Profiling error: $functionname\n" );
} else {
- if ($functionname == 'close') {
+ if ( $functionname == 'close' ) {
$message = "Profile section ended by close(): {$ofname}";
$functionname = $ofname;
$this->debug( "$message\n" );
$this->mCollated[$message] = $this->errorEntry;
}
- elseif ($ofname != $functionname) {
+ elseif ( $ofname != $functionname ) {
$message = "Profiling error: in({$ofname}), out($functionname)";
$this->debug( "$message\n" );
$this->mCollated[$message] = $this->errorEntry;
@@ -91,7 +91,7 @@ class ProfilerSimple extends Profiler {
$entry =& $this->mCollated[$functionname];
$elapsedcpu = $this->getTime( 'cpu' ) - $octime;
$elapsedreal = $this->getTime() - $ortime;
- if (!is_array($entry)) {
+ if ( !is_array( $entry ) ) {
$entry = $this->zeroEntry;
$this->mCollated[$functionname] =& $entry;
}