* @return Language
*/
function wfUILang() {
- # wfDeprecated( __METHOD__, '1.18' ); // See r105985 and it's revert. Somewhere still used.
+ wfDeprecated( __METHOD__, '1.18' );
global $wgLang;
return $wgLang;
}
function wfMkdirParents( $dir, $mode = null, $caller = null ) {
global $wgDirectoryMode;
+ if ( FileBackend::isStoragePath( $dir ) ) { // sanity
+ throw new MWException( __FUNCTION__ . " given storage path `$dir`.");
+ }
+
if ( !is_null( $caller ) ) {
wfDebug( "$caller: called wfMkdirParents($dir)\n" );
}
*/
function wfDeprecated( $function, $version = false, $component = false ) {
static $functionsWarned = array();
-
- if ( !isset( $functionsWarned[$function] ) ) {
+
+ MWDebug::deprecated( $function, $version, $component );
+
+ if ( !in_array( $function, $GLOBALS['wgDeprecationWhitelist'] ) && !isset( $functionsWarned[$function] ) ) {
$functionsWarned[$function] = true;
- if ( $version && $component === false ) {
+ if ( $version ) {
global $wgDeprecationReleaseLimit;
- if ( $wgDeprecationReleaseLimit ) {
+ if ( $wgDeprecationReleaseLimit && $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
function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
global $wgDevelopmentWarnings;
+ MWDebug::warning( $msg, $callerOffset + 2 );
+
$callers = wfDebugBacktrace();
if ( isset( $callers[$callerOffset + 1] ) ) {
$callerfunc = $callers[$callerOffset + 1];