Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3444,27 +3444,35 @@ |
3445 | 3445 | * Throws a warning that $function is deprecated |
3446 | 3446 | * |
3447 | 3447 | * @param $function String |
3448 | | - * @param $version String |
| 3448 | + * @param $version String|false: Added in 1.19. |
| 3449 | + * @param $component String|false: Added in 1.19. |
| 3450 | + * |
3449 | 3451 | * @return null |
3450 | 3452 | */ |
3451 | | -function wfDeprecated( $function, $version = false ) { |
| 3453 | +function wfDeprecated( $function, $version = false, $component = false ) { |
3452 | 3454 | static $functionsWarned = array(); |
| 3455 | + |
3453 | 3456 | if ( !isset( $functionsWarned[$function] ) ) { |
3454 | 3457 | $functionsWarned[$function] = true; |
| 3458 | + |
3455 | 3459 | if ( $version ) { |
3456 | 3460 | global $wgDeprecationReleaseLimit; |
| 3461 | + |
3457 | 3462 | if ( $wgDeprecationReleaseLimit ) { |
3458 | 3463 | # Strip -* off the end of $version so that branches can use the |
3459 | 3464 | # format #.##-branchname to avoid issues if the branch is merged into |
3460 | 3465 | # a version of MediaWiki later than what it was branched from |
3461 | 3466 | $comparableVersion = preg_replace( '/-.*$/', '', $version ); |
| 3467 | + |
3462 | 3468 | # If the comparableVersion is larger than our release limit then |
3463 | 3469 | # skip the warning message for the deprecation |
3464 | 3470 | if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) { |
3465 | 3471 | return; |
3466 | 3472 | } |
3467 | 3473 | } |
3468 | | - wfWarn( "Use of $function was deprecated in $version.", 2 ); |
| 3474 | + |
| 3475 | + $component = $component === false ? 'MediaWiki' : $component; |
| 3476 | + wfWarn( "Use of $function was deprecated in $component $version.", 2 ); |
3469 | 3477 | } else { |
3470 | 3478 | wfWarn( "Use of $function is deprecated.", 2 ); |
3471 | 3479 | } |