r89241 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89240‎ | r89241 | r89242 >
Date:23:50, 31 May 2011
Author:tstarling
Status:ok
Tags:
Comment:
Fix for r89206, r89218: always supply constructor parameters
Modified paths:
  • /trunk/phase3/includes/profiler/Profiler.php (modified) (history)
  • /trunk/phase3/includes/profiler/ProfilerSimple.php (modified) (history)
  • /trunk/phase3/includes/profiler/ProfilerSimpleText.php (modified) (history)
  • /trunk/phase3/includes/profiler/ProfilerSimpleTrace.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/profiler/ProfilerSimpleTrace.php
@@ -14,8 +14,9 @@
1515 var $trace = "";
1616 var $memory = 0;
1717
18 - function __construct() {
 18+ function __construct( $params ) {
1919 global $wgRequestTime, $wgRUstart;
 20+ parent::__construct( $params );
2021 if ( !empty( $wgRequestTime ) && !empty( $wgRUstart ) ) {
2122 $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, $this->getCpuTime( $wgRUstart ) );
2223 }
Index: trunk/phase3/includes/profiler/ProfilerSimple.php
@@ -12,8 +12,9 @@
1313 class ProfilerSimple extends Profiler {
1414 var $mMinimumTime = 0;
1515
16 - function __construct() {
 16+ function __construct( $params ) {
1717 global $wgRequestTime, $wgRUstart;
 18+ parent::__construct( $params );
1819 if (!empty($wgRequestTime) && !empty($wgRUstart)) {
1920 $this->mWorkStack[] = array( '-total', 0, $wgRequestTime,$this->getCpuTime($wgRUstart));
2021
Index: trunk/phase3/includes/profiler/ProfilerSimpleText.php
@@ -22,7 +22,7 @@
2323 if( isset( $profileConfig['visible'] ) && $profileConfig['visible'] ) {
2424 $this->visible = true;
2525 }
26 - parent::__construct();
 26+ parent::__construct( $profileConfig );
2727 }
2828
2929 public function logData() {
Index: trunk/phase3/includes/profiler/Profiler.php
@@ -42,7 +42,7 @@
4343 protected $mProfileID = false;
4444 private static $__instance = null;
4545
46 - function __construct( $params = null ) {
 46+ function __construct( $params ) {
4747 // Push an entry for the pre-profile setup time onto the stack
4848 global $wgRequestTime;
4949 if ( !empty( $wgRequestTime ) ) {
@@ -69,7 +69,7 @@
7070 } elseif( $wgProfiler instanceof Profiler ) {
7171 self::$__instance = $wgProfiler; // back-compat
7272 } else {
73 - self::$__instance = new ProfilerStub;
 73+ self::$__instance = new ProfilerStub( $wgProfiler );
7474 }
7575 }
7676 return self::$__instance;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89206* Made the profiler work in HipHop:...tstarling06:05, 31 May 2011
r89218Profiler can be constructed without param...hashar17:18, 31 May 2011

Status & tagging log