X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FGlobalFunctions.php;h=1cff881c210ffdd6905234a9e13bef79b4c39993;hb=5120937028f768749d058aa91dde82a96de0af1c;hp=484dfe8d4d624050a1fa78dd503b9ed3d0e67667;hpb=52ba4e60846b7c47d7b460beee82654346c41093;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 484dfe8d4d..1cff881c21 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2259,6 +2259,7 @@ function wfEscapeShellArg( /*...*/ ) { * @deprecated since 1.30 use MediaWiki\Shell::isDisabled() */ function wfShellExecDisabled() { + wfDeprecated( __FUNCTION__, '1.30' ); return Shell::isDisabled() ? 'disabled' : false; } @@ -2350,6 +2351,7 @@ function wfShellExecWithStderr( $cmd, &$retval = null, $environ = [], $limits = * @see $wgShellLocale */ function wfInitShellLocale() { + wfDeprecated( __FUNCTION__, '1.30' ); } /** @@ -2682,6 +2684,7 @@ function wfRelativePath( $path, $from ) { function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = true, $engine = 'auto' ) { + wfDeprecated( __FUNCTION__, '1.27' ); return Wikimedia\base_convert( $input, $sourceBase, $destBase, $pad, $lowercase, $engine ); } @@ -3045,6 +3048,8 @@ function wfWaitForSlaves( * Count down from $seconds to zero on the terminal, with a one-second pause * between showing each number. For use in command-line scripts. * + * @deprecated since 1.31, use Maintenance::countDown() + * * @codeCoverageIgnore * @param int $seconds */ @@ -3166,29 +3171,13 @@ function wfShorthandToInteger( $string = '', $default = -1 ) { * See unit test for examples. * See mediawiki.language.bcp47 for the JavaScript implementation. * + * @deprecated since 1.31, use LanguageCode::bcp47() directly. + * * @param string $code The language code. * @return string The language code which complying with BCP 47 standards. */ function wfBCP47( $code ) { - $codeSegment = explode( '-', $code ); - $codeBCP = []; - foreach ( $codeSegment as $segNo => $seg ) { - // when previous segment is x, it is a private segment and should be lc - if ( $segNo > 0 && strtolower( $codeSegment[( $segNo - 1 )] ) == 'x' ) { - $codeBCP[$segNo] = strtolower( $seg ); - // ISO 3166 country code - } elseif ( ( strlen( $seg ) == 2 ) && ( $segNo > 0 ) ) { - $codeBCP[$segNo] = strtoupper( $seg ); - // ISO 15924 script code - } elseif ( ( strlen( $seg ) == 4 ) && ( $segNo > 0 ) ) { - $codeBCP[$segNo] = ucfirst( strtolower( $seg ) ); - // Use lowercase for other cases - } else { - $codeBCP[$segNo] = strtolower( $seg ); - } - } - $langCode = implode( '-', $codeBCP ); - return $langCode; + return LanguageCode::bcp47( $code ); } /** @@ -3243,6 +3232,7 @@ function wfGetParserCacheStorage() { * @deprecated since 1.25 - use Hooks::run */ function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) { + wfDeprecated( __METHOD__, '1.25' ); return Hooks::run( $event, $args, $deprecatedVersion ); }