X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=blobdiff_plain;f=maintenance%2FupdateCredits.php;h=25ce3ceb12572323a82e767df83d2f912e6ff4a6;hb=bd7ff019c9bce29d195b59c2c5b4cb0d34dc6d93;hp=287a40c558ee55d8415f43e9dae45dcc9683e660;hpb=f7e1770fb832aa77bf4e16ce8cc815f2b24dd10d;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}";