mediawiki-extensions-Echo/scripts/gen-autoload.php
Erik Bernhardson 7dfbe0ab03 Hygiene: Use the core AutoloadGenerator
Change-Id: I500bb17680a8d0756f09d1f57a0e1a02439bf618
2014-11-19 09:16:43 -08:00

31 lines
573 B
PHP

<?php
require_once __DIR__ . '/../../../includes/utils/AutoloadGenerator.php';
function main() {
$base = dirname( __DIR__ );
$generator = new AutoloadGenerator( $base );
$dirs = array(
'api',
'controller',
'formatters',
'includes',
'jobs',
'model',
'special',
'tests',
);
foreach ( $dirs as $dir ) {
$generator->readDir( $base . '/' . $dir );
}
foreach ( glob( $base . '/*.php' ) as $file ) {
$generator->readFile( $file );
}
$generator->generateAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) );
echo "Done.\n\n";
}
main();