MediaWiki
REL1_32
generateLocalAutoload.php
Go to the documentation of this file.
1
<?php
2
3
if
( PHP_SAPI !=
'cli'
&& PHP_SAPI !=
'phpdbg'
) {
4
die(
"This script can only be run from the command line.\n"
);
5
}
6
7
require_once __DIR__ .
'/../includes/AutoLoader.php'
;
8
require_once __DIR__ .
'/../includes/utils/AutoloadGenerator.php'
;
9
10
// Mediawiki installation directory
11
$base
= dirname( __DIR__ );
12
13
$generator
=
new
AutoloadGenerator
(
$base
,
'local'
);
14
$generator
->setPsr4Namespaces(
AutoLoader::getAutoloadNamespaces
() );
15
$generator
->initMediaWikiDefault();
16
17
// Write out the autoload
18
$fileinfo
=
$generator
->getTargetFileinfo();
19
file_put_contents(
20
$fileinfo
[
'filename'
],
21
$generator
->getAutoload(
'maintenance/generateLocalAutoload.php'
)
22
);
AutoLoader\getAutoloadNamespaces
static getAutoloadNamespaces()
Get a mapping of namespace => file path The namespaces should follow the PSR-4 standard for autoloadi...
Definition
AutoLoader.php:130
AutoloadGenerator
Accepts a list of files and directories to search for php files and generates $wgAutoloadLocalClasses...
Definition
AutoloadGenerator.php:16
$fileinfo
$fileinfo
Definition
generateLocalAutoload.php:18
$generator
$generator
Definition
generateLocalAutoload.php:13
$base
$base
Definition
generateLocalAutoload.php:11
maintenance
generateLocalAutoload.php
Generated on Mon Nov 25 2024 15:58:19 for MediaWiki by
1.10.0