Similar to generateAutoload.php, this should work even without an active MW install. Fix the casing and signature to match the base class while at it. Change-Id: I1b0928f7bbb2c151c8350b4bbe503dd2a07da34e
29 lines
710 B
PHP
29 lines
710 B
PHP
<?php
|
|
require_once __DIR__ . '/Maintenance.php';
|
|
|
|
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' )
|
|
);
|
|
}
|
|
}
|
|
|
|
$maintClass = GenerateAutoload::class;
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|