$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;
*/
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
# 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;
}
}