From fef24bc6ff526c543b4c164e30514f1ac8ff803f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 6 May 2008 00:59:16 +0000 Subject: [PATCH] Send wfDeprecated notices to the debug log only. We don't actually want to fix all of these occurrences. --- includes/GlobalFunctions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index fb2dfaa66e..27b5a5d396 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2547,6 +2547,10 @@ function wfMaxlagError( $host, $lag, $maxLag ) { * @return null */ function wfDeprecated( $function ) { + global $wgDebugLogFile; + if ( !$wgDebugLogFile ) { + return; + } $callers = wfDebugBacktrace(); if( isset( $callers[2] ) ){ $callerfunc = $callers[2]; @@ -2560,10 +2564,11 @@ function wfDeprecated( $function ) { if( isset( $callerfunc['class'] ) ) $func .= $callerfunc['class'] . '::'; $func .= @$callerfunc['function']; - trigger_error( "Use of $function is deprecated. Called from $func in $file", E_USER_NOTICE ); + $msg = "Use of $function is deprecated. Called from $func in $file"; } else { - trigger_error( "Use of $function is deprecated.", E_USER_NOTICE ); + $msg = "Use of $function is deprecated."; } + wfDebug( "$msg\n" ); } /** -- 2.20.1