summaryrefslogtreecommitdiff
path: root/maintenance/generateLocalAutoload.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/generateLocalAutoload.php')
-rw-r--r--maintenance/generateLocalAutoload.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/maintenance/generateLocalAutoload.php b/maintenance/generateLocalAutoload.php
new file mode 100644
index 00000000..b8caa4d9
--- /dev/null
+++ b/maintenance/generateLocalAutoload.php
@@ -0,0 +1,25 @@
+<?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 ) {
+ $generator->readDir( $base . '/' . $dir );
+}
+foreach ( glob( $base . '/*.php' ) as $file ) {
+ $generator->readFile( $file );
+}
+
+// This class is not defined, but might be added by the installer
+$generator->forceClassPath( 'MyLocalSettingsGenerator', "$base/mw-config/overrides.php" );
+
+// Write out the autoload
+$generator->generateAutoload( 'maintenance/generateLocalAutoload.php' );
+