summaryrefslogtreecommitdiff
path: root/www/wiki/maintenance/generateLocalAutoload.php
blob: 189858c5af5d9e06b1bc7f0032d9d4c2d161c526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

if ( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) {
	die( "This script can only be run from the command line.\n" );
}

require_once __DIR__ . '/../includes/AutoLoader.php';
require_once __DIR__ . '/../includes/utils/AutoloadGenerator.php';

// Mediawiki installation directory
$base = dirname( __DIR__ );

$generator = new AutoloadGenerator( $base, 'local' );
$generator->setExcludePaths( array_values( AutoLoader::getAutoloadNamespaces() ) );
$generator->initMediaWikiDefault();

// Write out the autoload
$fileinfo = $generator->getTargetFileinfo();
file_put_contents(
	$fileinfo['filename'],
	$generator->getAutoload( 'maintenance/generateLocalAutoload.php' )
);