This allows the script to be used by MediaWiki extensions.
Example in UploadWizard: I181dda3ca3ef3f43e863482057b4949c1bc32e9b.
Change-Id: Ib121c6e226bdc1b3a8976c96b8d9f21546a1b5d3
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 -->';
$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 ) {