X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcollation%2FIcuCollation.php;h=7d9f168fb910761a96308e16a49c0b30c4faf3ab;hb=5410cfccce9b0b84bc909506c9b66d3f27d6dba7;hp=5f401a588b2488e879be5ebb2fb0133c38d4b768;hpb=067b22566476639d404d1caaf9a460a4a0a398fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/collation/IcuCollation.php b/includes/collation/IcuCollation.php index 5f401a588b..7d9f168fb9 100644 --- a/includes/collation/IcuCollation.php +++ b/includes/collation/IcuCollation.php @@ -75,7 +75,7 @@ class IcuCollation extends Collation { * letters (denoted by keys starting with '-'). * * These are additions to (or subtractions from) the data stored in the - * first-letters-root.ser file (which among others includes full basic latin, + * first-letters-root.php data file (which among others includes full basic latin, * cyrillic and greek alphabets). * * "Separate letter" is a letter that would have a separate heading/section @@ -348,9 +348,10 @@ class IcuCollation extends Collation { * @throws MWException */ private function fetchFirstLetterData() { + global $IP; // Generate data from serialized data file if ( isset( self::$tailoringFirstLetters[$this->locale] ) ) { - $letters = wfGetPrecompiledData( 'first-letters-root.ser' ); + $letters = require "$IP/includes/collation/data/first-letters-root.php"; // Append additional characters $letters = array_merge( $letters, self::$tailoringFirstLetters[$this->locale] ); // Remove unnecessary ones, if any @@ -364,10 +365,15 @@ class IcuCollation extends Collation { $letters[] = $this->digitTransformLanguage->formatNum( $digit, true ); } } else { - $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" ); - if ( $letters === false ) { - throw new MWException( "MediaWiki does not support ICU locale " . - "\"{$this->locale}\"" ); + if ( $this->locale === 'root' ) { + $letters = require "$IP/includes/collation/data/first-letters-root.php"; + } else { + // FIXME: Is this still used? + $letters = wfGetPrecompiledData( "first-letters-{$this->locale}.ser" ); + if ( $letters === false ) { + throw new MWException( "MediaWiki does not support ICU locale " . + "\"{$this->locale}\"" ); + } } }