r88354 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88353‎ | r88354 | r88355 >
Date:21:54, 17 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
Fixing typo from r55396 + code styl/whitespace
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3211,32 +3211,33 @@
32123212 * $wgDevelopmentWarnings
32133213 *
32143214 * @param $msg String: message to send
3215 - * @param $callerOffset Integer: number of itmes to go back in the backtrace to
 3215+ * @param $callerOffset Integer: number of items to go back in the backtrace to
32163216 * find the correct caller (1 = function calling wfWarn, ...)
32173217 * @param $level Integer: PHP error level; only used when $wgDevelopmentWarnings
32183218 * is true
32193219 */
32203220 function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
 3221+ global $wgDevelopmentWarnings;
 3222+
32213223 $callers = wfDebugBacktrace();
3222 - if( isset( $callers[$callerOffset + 1] ) ){
 3224+ if ( isset( $callers[$callerOffset + 1] ) ) {
32233225 $callerfunc = $callers[$callerOffset + 1];
32243226 $callerfile = $callers[$callerOffset];
3225 - if( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
 3227+ if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
32263228 $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
32273229 } else {
32283230 $file = '(internal function)';
32293231 }
32303232 $func = '';
3231 - if( isset( $callerfunc['class'] ) ) {
 3233+ if ( isset( $callerfunc['class'] ) ) {
32323234 $func .= $callerfunc['class'] . '::';
32333235 }
3234 - if( isset( $callerfunc['function'] ) ) {
 3236+ if ( isset( $callerfunc['function'] ) ) {
32353237 $func .= $callerfunc['function'];
32363238 }
32373239 $msg .= " [Called from $func in $file]";
32383240 }
32393241
3240 - global $wgDevelopmentWarnings;
32413242 if ( $wgDevelopmentWarnings ) {
32423243 trigger_error( $msg, $level );
32433244 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55396Document wfWarn() functionialex21:35, 20 August 2009

Status & tagging log