r50316 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50315‎ | r50316 | r50317 >
Date:18:30, 7 May 2009
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Removed StartProfiler.php from SVN control and added StartProfiler.sample file. The sample file can be moved to the former name to set profiling. MW will fall back to ProfilerStub.php as usual if there is no StartProfiler.php.
Modified paths:
  • /trunk/phase3 (modified) (history)
  • /trunk/phase3/StartProfiler.php (deleted) (history)
  • /trunk/phase3/StartProfiler.sample (added) (history)
  • /trunk/phase3/includes/WebStart.php (modified) (history)

Diff [purge]

Index: trunk/phase3/StartProfiler.php
@@ -1,22 +0,0 @@
2 -<?php
3 -
4 -require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
5 -
6 -/**
7 - * To use a profiler, delete the line above and add something like this:
8 - *
9 - * require_once( dirname(__FILE__).'/includes/Profiler.php' );
10 - * $wgProfiler = new Profiler;
11 - *
12 - * Or for a sampling profiler:
13 - * if ( !mt_rand( 0, 100 ) ) {
14 - * require_once( dirname(__FILE__).'/includes/Profiler.php' );
15 - * $wgProfiler = new Profiler;
16 - * } else {
17 - * require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
18 - * }
19 - *
20 - * Configuration of the profiler output can be done in LocalSettings.php
21 - */
22 -
23 -
Index: trunk/phase3/StartProfiler.sample
@@ -0,0 +1,23 @@
 2+<?php
 3+
 4+require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
 5+
 6+/**
 7+ * To use a profiler, copy this file to StartProfiler.php,
 8+ * delete the PHP line above, and add something like this:
 9+ *
 10+ * require_once( dirname(__FILE__).'/includes/Profiler.php' );
 11+ * $wgProfiler = new Profiler;
 12+ *
 13+ * Or for a sampling profiler:
 14+ * if ( !mt_rand( 0, 100 ) ) {
 15+ * require_once( dirname(__FILE__).'/includes/Profiler.php' );
 16+ * $wgProfiler = new Profiler;
 17+ * } else {
 18+ * require_once( dirname(__FILE__).'/includes/ProfilerStub.php' );
 19+ * }
 20+ *
 21+ * Configuration of the profiler output can be done in LocalSettings.php
 22+ */
 23+
 24+
Property changes on: trunk/phase3/StartProfiler.sample
___________________________________________________________________
Name: svn:eol-style
125 + native
Index: trunk/phase3/includes/WebStart.php
@@ -65,7 +65,11 @@
6666
6767
6868 # Start profiler
69 -require_once( "$IP/StartProfiler.php" );
 69+if( file_exists("$IP/StartProfiler.php") ) {
 70+ require_once( "$IP/StartProfiler.php" );
 71+} else {
 72+ require_once( "$IP/includes/ProfilerStub.php" );
 73+}
7074 wfProfileIn( 'WebStart.php-conf' );
7175
7276 # Load up some global defines.
Property changes on: trunk/phase3
___________________________________________________________________
Name: svn:ignore
7377 - LocalSettings.php
AdminSettings.php
StartProfiler.php
favicon.ico
*~
.classpath
.project
project.index
.metadata*
.settings
static*
7478 + *~
.classpath
.metadata*
.project
.settings
AdminSettings.php
LocalSettings.php
StartProfiler.php
favicon.ico
project.index
static*

Follow-up revisions

RevisionCommit summaryAuthorDate
r50324Followup to r50316: Fix inclusion of profiler in maintenance scripts.demon20:30, 7 May 2009
r50330* Fix for r50316 and r50324: require ProfilerStub.php if StartProfiler.php do...ialex08:54, 8 May 2009
r50331more fixes for r50316: changed StartProfiler.php to ProfilerStub.php so that ...ialex09:03, 8 May 2009

Comments

#Comment by IAlex (talk | contribs)   18:36, 7 May 2009

This broke maintenance scripts: Fatal error: require_once() [function.require]: Failed opening required 'StartProfiler.php' (include_path='.:/usr/lib/php') in maintenance/commandLine.inc on line 47

#Comment by Brion VIBBER (talk | contribs)   22:52, 7 May 2009

r50324 still leaves this:

Fatal error: Call to undefined function wfProfileIn() in /Library/WebServer/Documents/trunk/includes/Setup.php on line 22

#Comment by Aaron Schulz (talk | contribs)   23:03, 7 May 2009

What script? I'm not getting that error.

#Comment by IAlex (talk | contribs)   08:56, 8 May 2009

fixed in r50330.

Status & tagging log