Merge "Set explicit direction to ApiHelp headers with module names"
[lhc/web/wiklou.git] / maintenance / generateLocalAutoload.php
index 78e66b7..0d04c41 100644 (file)
@@ -1,12 +1,16 @@
 <?php
 
+if ( PHP_SAPI != 'cli' ) {
+       die( "This script can only be run from the command line.\n" );
+}
+
 require_once __DIR__ . '/../includes/utils/AutoloadGenerator.php';
 
 // Mediawiki installation directory
 $base = dirname( __DIR__ );
 
 $generator = new AutoloadGenerator( $base, 'local' );
-foreach ( array( 'includes', 'languages', 'maintenance', 'mw-config' ) as $dir ) {
+foreach ( [ 'includes', 'languages', 'maintenance', 'mw-config' ] as $dir ) {
        $generator->readDir( $base . '/' . $dir );
 }
 foreach ( glob( $base . '/*.php' ) as $file ) {
@@ -17,5 +21,4 @@ foreach ( glob( $base . '/*.php' ) as $file ) {
 $generator->forceClassPath( 'MyLocalSettingsGenerator', "$base/mw-config/overrides.php" );
 
 // Write out the autoload
-$generator->generateAutoload();
-
+$generator->generateAutoload( 'maintenance/generateLocalAutoload.php' );