Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:$wgAutoloadClasses

From mediawiki.org
Translate this page
Languages:
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:$wgAutoloadClasses??[] (1.34+)
[] (1.7-1.33)
Other settings:Alphabetical |By function

Details

[edit]

This array maps class and interface names to PHP filenames.MediaWiki core'sAutoLoader uses it to load those files.

MediaWiki version:
1.25

Extensions (and skins) specify this class mapping in theAutoloadClasses key ofextension.json (orskin.json), for example from theBoilerPlate extension'sextension.json:

{..."AutoloadClasses":{"BoilerPlateHooks":"BoilerPlate.hooks.php","SpecialHelloWorld":"specials/SpecialHelloWorld.php"},...}

Example prior to extension.json

[edit]

Assume the extensionNewExtension's files are in the directoryextensions/NewExtension.

IfNewExtension implements a class calledNewClass in the fileNewClass.php, then in its initialization fileNewExtension/NewExtension.php it should add to$wgAutoloadClasses as follows:

$wgAutoloadClasses['NewClass']=__DIR__.'/NewClass.php';
Loading interfaces is done in the same manner as loading classes

See also

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:$wgAutoloadClasses&oldid=4908699"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp