X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateCredits.php;h=25ce3ceb12572323a82e767df83d2f912e6ff4a6;hb=9e78841aa08d6c295e5fcfe017836828b57142cf;hp=287a40c558ee55d8415f43e9dae45dcc9683e660;hpb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCredits.php b/maintenance/updateCredits.php index 287a40c558..25ce3ceb12 100644 --- a/maintenance/updateCredits.php +++ b/maintenance/updateCredits.php @@ -26,6 +26,12 @@ if ( PHP_SAPI != 'cli' ) { die( "This script can only be run from the command line.\n" ); } +// class Collator is provided by the intl extension. +// It is only suggested in composer.json, so remind here when not loaded. +if ( !extension_loaded( 'intl' ) ) { + die( "This script needs the 'intl' extension to be loaded." ); +} + $CREDITS = 'CREDITS'; $START_CONTRIBUTORS = ''; $END_CONTRIBUTORS = ''; @@ -69,7 +75,8 @@ foreach ( $lines as $line ) { } $contributors = array_keys( $contributors ); -$collator = Collator::create( 'uca-default-u-kn' ); +$collator = Collator::create( 'root' ); +$collator->setAttribute( Collator::NUMERIC_COLLATION, Collator::ON ); $collator->sort( $contributors ); array_walk( $contributors, function ( &$v, $k ) { $v = "* {$v}";