r106456 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106455‎ | r106456 | r106457 >
Date:18:32, 16 December 2011
Author:jeroendedauw
Status:reverted (Comments)
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3457,7 +3457,7 @@
34583458 function wfDeprecated( $function, $version = false, $component = false ) {
34593459 static $functionsWarned = array();
34603460
3461 - if ( !isset( $functionsWarned[$function] ) ) {
 3461+ if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) {
34623462 $functionsWarned[$function] = true;
34633463
34643464 if ( $version ) {
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4068,6 +4068,12 @@
40694069 */
40704070 $wgDeprecationReleaseLimit = '1.17';
40714071
 4072+/**
 4073+ * Function name whitelist for wfDeprecated warnings. You will not be warned
 4074+ * for usage of deprecated functions in this list.
 4075+ */
 4076+$wgDeprecationWhitelist = array();
 4077+
40724078 /** Only record profiling info for pages that took longer than this */
40734079 $wgProfileLimit = 0.0;
40744080

Follow-up revisions

RevisionCommit summaryAuthorDate
r106485follow up to r106456 - use one setting instead two, which apparently made my ...jeroendedauw23:13, 16 December 2011
r106872Revert r106456, r106485: system-wide setting seems to be intended to apply on...brion21:52, 20 December 2011

Comments

#Comment by Platonides (talk | contribs)   22:29, 16 December 2011

Why not merge $wgDeprecationReleaseLimit and $wgDeprecationWhitelist?

E.g. $wgDeprecationWarnings = array( 'limit' => "1.17", 'whitelist' => array() );

#Comment by Brion VIBBER (talk | contribs)   21:41, 20 December 2011

That sounds awkward to me.

#Comment by Brion VIBBER (talk | contribs)   21:43, 20 December 2011

This seems problematic for extensions, in that it would still suppress warnings in other code that hasn't opted in to that whitelist.

#Comment by Brion VIBBER (talk | contribs)   21:52, 20 December 2011

Reverted in r106872.

Status & tagging log