dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restore the newFromId() approach in SpecialNewpages::feedItemDesc
[lhc/web/wiklou.git]
/
maintenance
/
updateCredits.php
diff --git
a/maintenance/updateCredits.php
b/maintenance/updateCredits.php
index
a43e0ba
..
b7e8c1c
100644
(file)
--- a/
maintenance/updateCredits.php
+++ b/
maintenance/updateCredits.php
@@
-26,8
+26,6
@@
if ( PHP_SAPI != 'cli' ) {
die( "This script can only be run from the command line.\n" );
}
die( "This script can only be run from the command line.\n" );
}
-chdir( dirname( __DIR__ ) );
-
$CREDITS = 'CREDITS';
$START_CONTRIBUTORS = '<!-- BEGIN CONTRIBUTOR LIST -->';
$END_CONTRIBUTORS = '<!-- END CONTRIBUTOR LIST -->';
$CREDITS = 'CREDITS';
$START_CONTRIBUTORS = '<!-- BEGIN CONTRIBUTOR LIST -->';
$END_CONTRIBUTORS = '<!-- END CONTRIBUTOR LIST -->';
@@
-38,6
+36,10
@@
$header = [];
$contributors = [];
$footer = [];
$contributors = [];
$footer = [];
+if ( !file_exists( $CREDITS ) ) {
+ exit( 'No CREDITS file found. Are you running this script in the right directory?' );
+}
+
$lines = explode( "\n", file_get_contents( $CREDITS ) );
foreach ( $lines as $line ) {
if ( $inHeader ) {
$lines = explode( "\n", file_get_contents( $CREDITS ) );
foreach ( $lines as $line ) {
if ( $inHeader ) {
@@
-57,7
+59,7
@@
unset( $lines );
$lines = explode( "\n", shell_exec( 'git log --format="%aN"' ) );
foreach ( $lines as $line ) {
$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]' ) {
continue;
}
if ( substr( $line, 0, 5 ) === '[BOT]' ) {
@@
-67,7
+69,8
@@
foreach ( $lines as $line ) {
}
$contributors = array_keys( $contributors );
}
$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}";
$collator->sort( $contributors );
array_walk( $contributors, function ( &$v, $k ) {
$v = "* {$v}";