1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<?php
// @codeCoverageIgnoreStart
require_once __DIR__ . '/Maintenance.php';
// @codeCoverageIgnoreEnd
class GenerateAutoload extends Maintenance {
public function canExecuteWithoutLocalSettings(): bool {
return true;
}
public function getDbType() {
return self::DB_NONE;
}
public function execute() {
$generator = new AutoloadGenerator( MW_INSTALL_PATH, 'local' );
$generator->setPsr4Namespaces( AutoLoader::CORE_NAMESPACES );
$generator->initMediaWikiDefault();
// Write out the autoload
$fileinfo = $generator->getTargetFileinfo();
file_put_contents(
$fileinfo['filename'],
$generator->getAutoload( 'maintenance/generateLocalAutoload.php' )
);
}
}
// @codeCoverageIgnoreStart
$maintClass = GenerateAutoload::class;
require_once RUN_MAINTENANCE_IF_MAIN;
// @codeCoverageIgnoreEnd
|