If a class is added manually to the autoload.php another run of the maintenance script will probably add unnecessary noise to another change. The added structure test checks, if the output of the maintenance script equals to the contents of the commited autoload.php. Bug: T121921 Change-Id: I3a426b92892f4c00cab33a13f6a717751120367c
20 lines
510 B
PHP
20 lines
510 B
PHP
<?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' );
|
|
$generator->initMediaWikiDefault();
|
|
|
|
// Write out the autoload
|
|
$fileinfo = $generator->getTargetFileinfo();
|
|
file_put_contents(
|
|
$fileinfo['filename'],
|
|
$generator->getAutoload( 'maintenance/generateLocalAutoload.php' )
|
|
);
|