Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3012,19 +3012,19 @@ |
3013 | 3013 | } |
3014 | 3014 | |
3015 | 3015 | /** |
3016 | | - * Throws an E_USER_NOTICE saying that $function is deprecated |
| 3016 | + * Throws a warning that $function is deprecated |
3017 | 3017 | * @param string $function |
3018 | 3018 | * @return null |
3019 | 3019 | */ |
3020 | 3020 | function wfDeprecated( $function ) { |
3021 | | - global $wgDebugLogFile; |
3022 | | - if ( !$wgDebugLogFile ) { |
3023 | | - return; |
3024 | | - } |
| 3021 | + wfWarn( "Use of $function is deprecated.", 2 ); |
| 3022 | +} |
| 3023 | + |
| 3024 | +function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) { |
3025 | 3025 | $callers = wfDebugBacktrace(); |
3026 | | - if( isset( $callers[2] ) ){ |
3027 | | - $callerfunc = $callers[2]; |
3028 | | - $callerfile = $callers[1]; |
| 3026 | + if( isset( $callers[$callerOffset+1] ) ){ |
| 3027 | + $callerfunc = $callers[$callerOffset+1]; |
| 3028 | + $callerfile = $callers[$callerOffset]; |
3029 | 3029 | if( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ){ |
3030 | 3030 | $file = $callerfile['file'] . ' at line ' . $callerfile['line']; |
3031 | 3031 | } else { |
— | — | @@ -3034,11 +3034,15 @@ |
3035 | 3035 | if( isset( $callerfunc['class'] ) ) |
3036 | 3036 | $func .= $callerfunc['class'] . '::'; |
3037 | 3037 | $func .= @$callerfunc['function']; |
3038 | | - $msg = "Use of $function is deprecated. Called from $func in $file"; |
| 3038 | + $msg .= " [Called from $func in $file]"; |
| 3039 | + } |
| 3040 | + |
| 3041 | + global $wgDevelopmentWarnings; |
| 3042 | + if ( $wgDevelopmentWarnings ) { |
| 3043 | + trigger_error( $msg, $level ); |
3039 | 3044 | } else { |
3040 | | - $msg = "Use of $function is deprecated."; |
| 3045 | + wfDebug( "$msg\n" ); |
3041 | 3046 | } |
3042 | | - wfDebug( "$msg\n" ); |
3043 | 3047 | } |
3044 | 3048 | |
3045 | 3049 | /** |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1088,6 +1088,12 @@ |
1089 | 1089 | $wgShowHostnames = false; |
1090 | 1090 | |
1091 | 1091 | /** |
| 1092 | + * If set to true MediaWiki will throw notices for some possible error |
| 1093 | + * conditions and for deprecated functions. |
| 1094 | + */ |
| 1095 | +$wgDevelopmentWarnings = false; |
| 1096 | + |
| 1097 | +/** |
1092 | 1098 | * Use experimental, DMOZ-like category browser |
1093 | 1099 | */ |
1094 | 1100 | $wgUseCategoryBrowser = false; |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -597,6 +597,18 @@ |
598 | 598 | $aliases = $wgContLang->getSpecialPageAliases(); |
599 | 599 | if ( isset( $aliases[$name][0] ) ) { |
600 | 600 | $name = $aliases[$name][0]; |
| 601 | + } else { |
| 602 | + // Try harder in case someone misspelled the correct casing |
| 603 | + $found = false; |
| 604 | + foreach ( $aliases as $n => $values ) { |
| 605 | + if ( strcasecmp( $name, $n ) === 0 ) { |
| 606 | + wfWarn( "Found $n for $name with casefix" ); |
| 607 | + $name = $values[0]; |
| 608 | + $found = true; |
| 609 | + break; |
| 610 | + } |
| 611 | + } |
| 612 | + if ( !$found ) wfWarn( "Did not found name for special page $name" ); |
601 | 613 | } |
602 | 614 | if ( $subpage !== false && !is_null( $subpage ) ) { |
603 | 615 | $name = "$name/$subpage"; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -29,6 +29,8 @@ |
30 | 30 | * $wgAllowRealName was deprecated in favor of $wgHiddenPrefs[] = 'realname', |
31 | 31 | but the former is still retained for backwards-compatibility |
32 | 32 | * (bug 9257) $wgRCMaxAge now defaults to three months |
| 33 | +* $wgDevelopmentWarnings can be set to true to show warnings about deprecated |
| 34 | + functions and other potential errors when developing. |
33 | 35 | |
34 | 36 | === New features in 1.16 === |
35 | 37 | |
— | — | @@ -147,6 +149,7 @@ |
148 | 150 | * (bug 18432) Updated documentation for dumpBackup.php |
149 | 151 | * Fix array logic in Sanitizer::removeHTMLtags so that it doesn't strip good tags |
150 | 152 | that were redundantly defined. |
| 153 | +* (bug 14118) SpecialPage::getTitleFor does not return a localised name |
151 | 154 | |
152 | 155 | == API changes in 1.16 == |
153 | 156 | |