introduce a new setting that allows extension authors to whitelist deprecated funtion...
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Fri, 16 Dec 2011 18:32:45 +0000 (18:32 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Fri, 16 Dec 2011 18:32:45 +0000 (18:32 +0000)
includes/DefaultSettings.php
includes/GlobalFunctions.php

index 97ea26b..5d3d437 100644 (file)
@@ -4068,6 +4068,12 @@ $wgDevelopmentWarnings = false;
  */
 $wgDeprecationReleaseLimit = '1.17';
 
+/**
+ * Function name whitelist for wfDeprecated warnings. You will not be warned
+ * for usage of deprecated functions in this list.
+ */
+$wgDeprecationWhitelist = array();
+
 /** Only record profiling info for pages that took longer than this */
 $wgProfileLimit = 0.0;
 
index 143f5f1..c8c9bfa 100644 (file)
@@ -3457,7 +3457,7 @@ function wfGetNull() {
 function wfDeprecated( $function, $version = false, $component = false ) {
        static $functionsWarned = array();
        
-       if ( !isset( $functionsWarned[$function] ) ) {
+       if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) {
                $functionsWarned[$function] = true;
                
                if ( $version ) {