r33917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33916‎ | r33917 | r33918 >
Date:17:57, 26 April 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Print caller if possible in deprecated warnings
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2506,7 +2506,15 @@
25072507 * @return null
25082508 */
25092509 function wfDeprecated( $function ) {
2510 - trigger_error( "Use of $function is deprecated", E_USER_NOTICE );
 2510+ $callers = debug_backtrace();
 2511+ $file = @$callers[2]['file'];
 2512+ $line = @$callers[2]['line'];
 2513+ $func = @$callers[2]['function'];
 2514+ if ( $func && $file ) {
 2515+ trigger_error( "Use of $function is deprecated. Called from $func at $file:$line", E_USER_NOTICE );
 2516+ } else {
 2517+ trigger_error( "Use of $function is deprecated.", E_USER_NOTICE );
 2518+ }
25112519 }
25122520
25132521 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r33924tweaks for r33917:...ialex19:09, 26 April 2008

Status & tagging log