From 9952b6692c181e0f9bf355b7d0cce4447d554b0b Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Fri, 16 Dec 2011 18:32:45 +0000 Subject: [PATCH] introduce a new setting that allows extension authors to whitelist deprecated funtion usage for functions they do not wish to update due to backward compat reasons for a while --- includes/DefaultSettings.php | 6 ++++++ includes/GlobalFunctions.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 97ea26b4d1..5d3d437fbb 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 143f5f1c8d..c8c9bfa84a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ) { -- 2.20.1