From: Niklas Laxström Date: Sat, 26 Apr 2008 17:57:29 +0000 (+0000) Subject: * Print caller if possible in deprecated warnings X-Git-Tag: 1.31.0-rc.0~48057 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=87e9fc60349ad735052ee2b0280f286f31a23cde;p=lhc%2Fweb%2Fwiklou.git * Print caller if possible in deprecated warnings --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7497b22009..94a1508488 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2506,7 +2506,15 @@ function wfMaxlagError( $host, $lag, $maxLag ) { * @return null */ function wfDeprecated( $function ) { - trigger_error( "Use of $function is deprecated", E_USER_NOTICE ); + $callers = debug_backtrace(); + $file = @$callers[2]['file']; + $line = @$callers[2]['line']; + $func = @$callers[2]['function']; + if ( $func && $file ) { + trigger_error( "Use of $function is deprecated. Called from $func at $file:$line", E_USER_NOTICE ); + } else { + trigger_error( "Use of $function is deprecated.", E_USER_NOTICE ); + } } /**