r106485 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106484‎ | r106485 | r106486 >
Date:23:13, 16 December 2011
Author:jeroendedauw
Status:reverted (Comments)
Tags:
Comment:
follow up to r106456 - use one setting instead two, which apparently made my commit into a fixme
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3456,14 +3456,13 @@
34573457 */
34583458 function wfDeprecated( $function, $version = false, $component = false ) {
34593459 static $functionsWarned = array();
 3460+ global $wgDeprecationWarnings;
34603461
3461 - if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) {
 3462+ if ( !in_array( $function, $wgDeprecationWarnings['whitelist'] ) && !isset( $functionsWarned[$function] ) ) {
34623463 $functionsWarned[$function] = true;
34633464
34643465 if ( $version ) {
3465 - global $wgDeprecationReleaseLimit;
3466 -
3467 - if ( $wgDeprecationReleaseLimit && $component === false ) {
 3466+ if ( $wgDeprecationWarnings['limit'] && $component === false ) {
34683467 # Strip -* off the end of $version so that branches can use the
34693468 # format #.##-branchname to avoid issues if the branch is merged into
34703469 # a version of MediaWiki later than what it was branched from
@@ -3471,7 +3470,7 @@
34723471
34733472 # If the comparableVersion is larger than our release limit then
34743473 # skip the warning message for the deprecation
3475 - if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
 3474+ if ( version_compare( $wgDeprecationWarnings['limit'], $comparableVersion, '<' ) ) {
34763475 return;
34773476 }
34783477 }
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4062,17 +4062,16 @@
40634063 $wgDevelopmentWarnings = false;
40644064
40654065 /**
 4066+ * $wgDeprecationWarnings['limit']
40664067 * Release limitation to wfDeprecated warnings, if set to a release number
40674068 * development warnings will not be generated for deprecations added in releases
40684069 * after the limit.
4069 - */
4070 -$wgDeprecationReleaseLimit = '1.17';
4071 -
4072 -/**
 4070+ *
 4071+ * $wgDeprecationWarnings['whitelist']
40734072 * Function name whitelist for wfDeprecated warnings. You will not be warned
40744073 * for usage of deprecated functions in this list.
40754074 */
4076 -$wgDeprecationWhitelist = array();
 4075+$wgDeprecationWarnings = array( 'limit' => '1.17', 'whitelist' => array() );
40774076
40784077 /** Only record profiling info for pages that took longer than this */
40794078 $wgProfileLimit = 0.0;

Follow-up revisions

RevisionCommit summaryAuthorDate
r106872Revert r106456, r106485: system-wide setting seems to be intended to apply on...brion21:52, 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

Comments

#Comment by Platonides (talk | contribs)   14:38, 17 December 2011

Heh, I hadn't considered it worth a fixme, but apparently Aaron thought otherwise.

#Comment by Aaron Schulz (talk | contribs)   17:23, 17 December 2011

It was a "no reason not to improve while you have the chance" fixme :)

Status & tagging log