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