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=eb717e8c66c4739908b77876bb40bb4423f230f9;hpb=2c8f7978df47f338ee6e245e3efba6175ba425e9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCredits.php b/maintenance/updateCredits.php index eb717e8c66..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 = ''; @@ -59,7 +65,7 @@ unset( $lines ); $lines = explode( "\n", shell_exec( 'git log --format="%aN"' ) ); foreach ( $lines as $line ) { - if ( empty( $line ) ) { + if ( empty( $line ) ) { continue; } if ( substr( $line, 0, 5 ) === '[BOT]' ) { @@ -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}";