Manual:$wgAutoloadClasses
From MediaWiki.org
Extensions: $wgAutoloadClasses | |
---|---|
Array mapping class names to filenames, for autoloading. |
|
Introduced in version: | 1.7.0 (r15031) |
Removed in version: | still in use |
Allowed values: | (see below) |
Default value: | array() |
Other settings: Alphabetical | By Function
[edit] Details
Array mapping class names or interface names to filenames, for autoloading.
[edit] Example
Extension NewExtension is being implemented. The extension files are saved in the directory NewExtension, which is located in the extensions directory of the MediaWiki installation.
NewExtension is introducing a new class called NewClass, which is contained in the file NewClass.php
The proper settings for $wgAutoloadClasses is as follows:
$wgAutoloadClasses['NewClass'] = __DIR__ . '/NewClass.php';
Loading interfaces is done in the same manner as loading classes
[edit] See also
- $wgAutoloadLocalClasses — For autoloading files included in default MediaWiki.