From 5d3237fb9f92f078f0ee2b770318a48c1c8f9b23 Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Fri, 16 Dec 2011 23:13:10 +0000 Subject: [PATCH] follow up to r106456 - use one setting instead two, which apparently made my commit into a fixme --- includes/DefaultSettings.php | 9 ++++----- includes/GlobalFunctions.php | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5d3d437fbb..1fe7870ad3 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4062,17 +4062,16 @@ $wgShowHostnames = false; $wgDevelopmentWarnings = false; /** + * $wgDeprecationWarnings['limit'] * Release limitation to wfDeprecated warnings, if set to a release number * development warnings will not be generated for deprecations added in releases * after the limit. - */ -$wgDeprecationReleaseLimit = '1.17'; - -/** + * + * $wgDeprecationWarnings['whitelist'] * Function name whitelist for wfDeprecated warnings. You will not be warned * for usage of deprecated functions in this list. */ -$wgDeprecationWhitelist = array(); +$wgDeprecationWarnings = array( 'limit' => '1.17', 'whitelist' => 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 c8c9bfa84a..331922788d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3456,14 +3456,13 @@ function wfGetNull() { */ function wfDeprecated( $function, $version = false, $component = false ) { static $functionsWarned = array(); + global $wgDeprecationWarnings; - if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) { + if ( !in_array( $function, $wgDeprecationWarnings['whitelist'] ) && !isset( $functionsWarned[$function] ) ) { $functionsWarned[$function] = true; if ( $version ) { - global $wgDeprecationReleaseLimit; - - if ( $wgDeprecationReleaseLimit && $component === false ) { + if ( $wgDeprecationWarnings['limit'] && $component === false ) { # Strip -* off the end of $version so that branches can use the # format #.##-branchname to avoid issues if the branch is merged into # a version of MediaWiki later than what it was branched from @@ -3471,7 +3470,7 @@ function wfDeprecated( $function, $version = false, $component = false ) { # If the comparableVersion is larger than our release limit then # skip the warning message for the deprecation - if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) { + if ( version_compare( $wgDeprecationWarnings['limit'], $comparableVersion, '<' ) ) { return; } } -- 2.20.1