r106872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106871‎ | r106872 | r106873 >
Date:21:52, 20 December 2011
Author:brion
Status:ok
Tags:
Comment:
Revert r106456, r106485: system-wide setting seems to be intended to apply only to specific extensions' code but wouldn't? Also weird config parameter combining two unrelated things into one.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -4084,16 +4084,11 @@
40854085 $wgDevelopmentWarnings = false;
40864086
40874087 /**
4088 - * $wgDeprecationWarnings['limit']
40894088 * Release limitation to wfDeprecated warnings, if set to a release number
40904089 * development warnings will not be generated for deprecations added in releases
40914090 * after the limit.
4092 - *
4093 - * $wgDeprecationWarnings['whitelist']
4094 - * Function name whitelist for wfDeprecated warnings. You will not be warned
4095 - * for usage of deprecated functions in this list.
40964091 */
4097 -$wgDeprecationWarnings = array( 'limit' => '1.17', 'whitelist' => array() );
 4092+$wgDeprecationReleaseLimit = '1.17';
40984093
40994094 /** Only record profiling info for pages that took longer than this */
41004095 $wgProfileLimit = 0.0;
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3460,13 +3460,14 @@
34613461 */
34623462 function wfDeprecated( $function, $version = false, $component = false ) {
34633463 static $functionsWarned = array();
3464 - global $wgDeprecationWarnings;
34653464
3466 - if ( !in_array( $function, $wgDeprecationWarnings['whitelist'] ) && !isset( $functionsWarned[$function] ) ) {
 3465+ if ( !isset( $functionsWarned[$function] ) ) {
34673466 $functionsWarned[$function] = true;
34683467
34693468 if ( $version ) {
3470 - if ( $wgDeprecationWarnings['limit'] && $component === false ) {
 3469+ global $wgDeprecationReleaseLimit;
 3470+
 3471+ if ( $wgDeprecationReleaseLimit && $component === false ) {
34713472 # Strip -* off the end of $version so that branches can use the
34723473 # format #.##-branchname to avoid issues if the branch is merged into
34733474 # a version of MediaWiki later than what it was branched from
@@ -3474,7 +3475,7 @@
34753476
34763477 # If the comparableVersion is larger than our release limit then
34773478 # skip the warning message for the deprecation
3478 - if ( version_compare( $wgDeprecationWarnings['limit'], $comparableVersion, '<' ) ) {
 3479+ if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
34793480 return;
34803481 }
34813482 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r106883partial revert of r106872 after discussion with Brion on #mediawiki ircjeroendedauw22:45, 20 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106456introduce a new setting that allows extension authors to whitelist deprecated...jeroendedauw18:32, 16 December 2011
r106485follow up to r106456 - use one setting instead two, which apparently made my ...jeroendedauw23:13, 16 December 2011

Status & tagging log