96 'be-tarask' => [
"Ё" ],
97 'bs' => [
"Č",
"Ć",
"Dž",
"Đ",
"Lj",
"Nj",
"Š",
"Ž" ],
98 'cs' => [
"Č",
"Ch",
"Ř",
"Š",
"Ž" ],
99 'cy' => [
"Ch",
"Dd",
"Ff",
"Ng",
"Ll",
"Ph",
"Rh",
"Th" ],
109 'fi' => [
"Å",
"Ä",
"Ö" ],
111 'hr' => [
"Č",
"Ć",
"Dž",
"Đ",
"Lj",
"Nj",
"Š",
"Ž" ],
112 'hsb' => [
"Č",
"Dź",
"Ě",
"Ch",
"Ł",
"Ń",
"Ř",
"Š",
"Ć",
"Ž" ],
113 'hu' => [
"Cs",
"Dz",
"Dzs",
"Gy",
"Ly",
"Ny",
"Ö",
"Sz",
"Ty",
"Ü",
"Zs" ],
114 'is' => [
"Á",
"Ð",
"É",
"Í",
"Ó",
"Ú",
"Ý",
"Þ",
"Æ",
"Ö",
"Å" ],
116 'lt' => [
"Č",
"Š",
"Ž" ],
117 'lv' => [
"Č",
"Ģ",
"Ķ",
"Ļ",
"Ņ",
"Š",
"Ž" ],
118 'mk' => [
"Ѓ",
"Ќ" ],
120 'pl' => [
"Ą",
"Ć",
"Ę",
"Ł",
"Ń",
"Ó",
"Ś",
"Ź",
"Ż" ],
123 'sk' => [
"Ä",
"Č",
"Ch",
"Ô",
"Š",
"Ž" ],
125 'sv' => [
"Å",
"Ä",
"Ö" ],
126 'sv@collation=standard' => [
"Å",
"Ä",
"Ö" ],
128 "\xE0\xAE\x82",
"ஃ",
"க்ஷ",
"க்",
"ங்",
"ச்",
"ஞ்",
"ட்",
"ண்",
"த்",
"ந்",
129 "ப்",
"ம்",
"ய்",
"ர்",
"ல்",
"வ்",
"ழ்",
"ள்",
"ற்",
"ன்",
"ஜ்",
"ஶ்",
"ஷ்",
132 'uk' => [
"Ґ",
"Ь" ],
133 'vi' => [
"Ă",
"Â",
"Đ",
"Ê",
"Ô",
"Ơ",
"Ư" ],
136 'ast' => [
"Ch",
"Ll",
"Ñ" ],
137 'az' => [
"Ç",
"Ə",
"Ğ",
"İ",
"Ö",
"Ş",
"Ü" ],
139 'br' => [
"Ch",
"C'h" ],
142 'da' => [
"Æ",
"Ø",
"Å" ],
144 'dsb' => [
"Č",
"Ć",
"Dź",
"Ě",
"Ch",
"Ł",
"Ń",
"Ŕ",
"Š",
"Ś",
"Ž",
"Ź" ],
146 'eo' => [
"Ĉ",
"Ĝ",
"Ĥ",
"Ĵ",
"Ŝ",
"Ŭ" ],
148 'et' => [
"Š",
"Ž",
"Õ",
"Ä",
"Ö",
"Ü",
"W" ],
150 'fo' => [
"Á",
"Ð",
"Í",
"Ó",
"Ú",
"Ý",
"Æ",
"Ø",
"Å" ],
151 'fur' => [
"À",
"Á",
"Â",
"È",
"Ì",
"Ò",
"Ù" ],
155 'gl' => [
"Ch",
"Ll",
"Ñ" ],
156 'kk' => [
"Ү",
"І" ],
157 'kl' => [
"Æ",
"Ø",
"Å" ],
158 'ku' => [
"Ç",
"Ê",
"Î",
"Ş",
"Û" ],
162 'mo' => [
"Ă",
"Â",
"Î",
"Ş",
"Ţ" ],
163 'mt' => [
"Ċ",
"Ġ",
"Għ",
"Ħ",
"Ż" ],
164 'no' => [
"Æ",
"Ø",
"Å" ],
167 'ro' => [
"Ă",
"Â",
"Î",
"Ş",
"Ţ" ],
168 'rup' => [
"Ă",
"Â",
"Î",
"Ľ",
"Ń",
"Ş",
"Ţ" ],
170 'sl' => [
"Č",
"Š",
"Ž" ],
171 'smn' => [
"Á",
"Č",
"Đ",
"Ŋ",
"Š",
"Ŧ",
"Ž",
"Æ",
"Ø",
"Å",
"Ä",
"Ö" ],
172 'sq' => [
"Ç",
"Dh",
"Ë",
"Gj",
"Ll",
"Nj",
"Rr",
"Sh",
"Th",
"Xh",
"Zh" ],
173 'tk' => [
"Ç",
"Ä",
"Ž",
"Ň",
"Ö",
"Ş",
"Ü",
"Ý" ],
174 'tl' => [
"Ñ",
"Ng" ],
175 'tr' => [
"Ç",
"Ğ",
"İ",
"Ö",
"Ş",
"Ü" ],
176 'tt' => [
"Ә",
"Ө",
"Ү",
"Җ",
"Ң",
"Һ" ],
177 'uz' => [
"Ch",
"G'",
"Ng",
"O'",
"Sh" ],
186 if ( !extension_loaded(
'intl' ) ) {
187 throw new MWException(
'An ICU collation was requested, ' .
188 'but the intl extension is not available.' );
193 $localeParts = explode(
'@',
$locale );
194 $this->digitTransformLanguage = Language::factory(
$locale ===
'root' ?
'en' : $localeParts[0] );
196 $this->mainCollator = Collator::create(
$locale );
197 if ( !$this->mainCollator ) {
198 throw new MWException(
"Invalid ICU locale specified for collation: $locale" );
201 $this->primaryCollator = Collator::create(
$locale );
202 $this->primaryCollator->setStrength( Collator::PRIMARY );
205 if ( substr(
$locale, -5, 5 ) ===
'-u-kn' ) {
206 $this->useNumericCollation =
true;
208 $this->locale = substr( $this->locale, 0, -5 );
209 $this->mainCollator->setAttribute( Collator::NUMERIC_COLLATION, Collator::ON );
210 $this->primaryCollator->setAttribute( Collator::NUMERIC_COLLATION, Collator::ON );
215 return $this->mainCollator->getSortKey( $string );
219 return $this->primaryCollator->getSortKey( $string );
223 $string = strval( $string );
224 if ( $string ===
'' ) {
228 $firstChar = mb_substr( $string, 0, 1,
'UTF-8' );
231 if ( ord( $firstChar ) > 0x7f && self::isCjk(
UtfNormal\Utils::utf8ToCodepoint( $firstChar ) ) ) {
239 [ $this,
'getSortKeyByLetterIndex' ],
244 if ( $min ===
false ) {
251 if ( $this->useNumericCollation ) {
256 if ( ord( $sortLetter ) >= 48 && ord( $sortLetter ) <= 57 ) {
257 $sortLetter =
wfMessage(
'category-header-numerals' )->numParams( 0, 9 )->text();
268 if ( $this->firstLetterData ===
null ) {
270 $cacheKey =
$cache->makeKey(
273 $this->digitTransformLanguage->getCode(),
274 self::getICUVersion(),
275 self::FIRST_LETTER_VERSION
277 $this->firstLetterData =
$cache->getWithSetCallback( $cacheKey, $cache::TTL_WEEK,
function () {
290 if ( isset( self::$tailoringFirstLetters[$this->locale] ) ) {
293 $letters = array_merge( $letters, self::$tailoringFirstLetters[$this->locale] );
295 if ( isset( self::$tailoringFirstLetters[
'-' . $this->locale] ) ) {
296 $letters = array_diff( $letters, self::$tailoringFirstLetters[
'-' . $this->locale] );
299 $digits = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9' ];
300 $letters = array_diff( $letters, $digits );
301 foreach ( $digits
as $digit ) {
302 $letters[] = $this->digitTransformLanguage->formatNum( $digit,
true );
306 if ( $letters ===
false ) {
307 throw new MWException(
"MediaWiki does not support ICU locale " .
308 "\"{$this->locale}\"" );
322 foreach ( $letters
as $letter ) {
324 if ( isset( $letterMap[$key] ) ) {
327 if ( $this->mainCollator->compare( $letter, $letterMap[$key] ) < 0 ) {
328 $letterMap[$key] = $letter;
331 $letterMap[$key] = $letter;
334 ksort( $letterMap, SORT_STRING );
371 $duplicatePrefixes = [];
372 foreach ( $letterMap
as $key =>
$value ) {
375 $trimmedKey = rtrim( $key,
"\0" );
376 if ( $prev ===
false || $prev ===
'' ) {
389 if ( substr( $trimmedKey, 0, strlen( $prev ) ) === $prev ) {
390 $duplicatePrefixes[] = $key;
398 foreach ( $duplicatePrefixes
as $badKey ) {
399 wfDebug(
"Removing '{$letterMap[$badKey]}' from first letters.\n" );
400 unset( $letterMap[$badKey] );
404 'chars' => array_values( $letterMap ),
405 'keys' => array_keys( $letterMap ),
439 public static function isCjk( $codepoint ) {
440 foreach ( self::$cjkBlocks
as $block ) {
441 if ( $codepoint >= $block[0] && $codepoint <= $block[1] ) {
461 return defined(
'INTL_ICU_VERSION' ) ? INTL_ICU_VERSION :
false;
473 if ( !$icuVersion ) {
477 $versionPrefix = substr( $icuVersion, 0, 3 );
499 if ( isset( $map[$versionPrefix] ) ) {
500 return $map[$versionPrefix];
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetPrecompiledData( $name)
Get an object from the precompiled serialized directory.
static findLowerBound( $valueCallback, $valueCount, $comparisonCallback, $target)
Do a binary search, and return the index of the largest item that sorts less than or equal to the tar...
getLetterByIndex( $index)
getSortKeyByLetterIndex( $index)
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
getPrimarySortKey( $string)
static getICUVersion()
Return the version of ICU library used by PHP's intl extension, or false when the extension is not in...
boolean $useNumericCollation
static isCjk( $codepoint)
Test if a code point is a CJK (Chinese, Japanese, Korean) character.
const FIRST_LETTER_VERSION
static $cjkBlocks
Unified CJK blocks.
Language $digitTransformLanguage
Collator $primaryCollator
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
static $tailoringFirstLetters
Additional characters (or character groups) to be considered separate letters for given languages,...
static getUnicodeVersionForICU()
Return the version of Unicode appropriate for the version of ICU library currently in use,...
Internationalisation code.
Unicode normalization routines for working with UTF-8 strings.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
the array() calling protocol came about after MediaWiki 1.4rc1.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php