Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3211,32 +3211,33 @@ |
3212 | 3212 | * $wgDevelopmentWarnings |
3213 | 3213 | * |
3214 | 3214 | * @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 |
3216 | 3216 | * find the correct caller (1 = function calling wfWarn, ...) |
3217 | 3217 | * @param $level Integer: PHP error level; only used when $wgDevelopmentWarnings |
3218 | 3218 | * is true |
3219 | 3219 | */ |
3220 | 3220 | function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) { |
| 3221 | + global $wgDevelopmentWarnings; |
| 3222 | + |
3221 | 3223 | $callers = wfDebugBacktrace(); |
3222 | | - if( isset( $callers[$callerOffset + 1] ) ){ |
| 3224 | + if ( isset( $callers[$callerOffset + 1] ) ) { |
3223 | 3225 | $callerfunc = $callers[$callerOffset + 1]; |
3224 | 3226 | $callerfile = $callers[$callerOffset]; |
3225 | | - if( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) { |
| 3227 | + if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) { |
3226 | 3228 | $file = $callerfile['file'] . ' at line ' . $callerfile['line']; |
3227 | 3229 | } else { |
3228 | 3230 | $file = '(internal function)'; |
3229 | 3231 | } |
3230 | 3232 | $func = ''; |
3231 | | - if( isset( $callerfunc['class'] ) ) { |
| 3233 | + if ( isset( $callerfunc['class'] ) ) { |
3232 | 3234 | $func .= $callerfunc['class'] . '::'; |
3233 | 3235 | } |
3234 | | - if( isset( $callerfunc['function'] ) ) { |
| 3236 | + if ( isset( $callerfunc['function'] ) ) { |
3235 | 3237 | $func .= $callerfunc['function']; |
3236 | 3238 | } |
3237 | 3239 | $msg .= " [Called from $func in $file]"; |
3238 | 3240 | } |
3239 | 3241 | |
3240 | | - global $wgDevelopmentWarnings; |
3241 | 3242 | if ( $wgDevelopmentWarnings ) { |
3242 | 3243 | trigger_error( $msg, $level ); |
3243 | 3244 | } else { |