Manual:$wgAutoloadClasses

From MediaWiki.org
Jump to: navigation, search
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


Details [edit]

Array mapping class names or interface names to filenames, for autoloading.

Example [edit]

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

See also [edit]