Hundreds of globals are initialized on startup by MediaWiki. The majority of these global variables are configuration settings that are set in DefaultSettings.php
and LocalSettings.php . (See Manual:Configuration settings for documentation on these variables.) There is no comprehensive documentation for the remaining few hundred globals, however, some of the most important ones are listed below. They are typically initialized either in index.php or in Setup.php .Global variables
- $mediaWiki
$wgTitle
and$wgArticle
objects, and executes the URL actions.
- MediaWiki object, the main base class for the MediaWiki software. Initializes the - $wgArticle
$wgTitle
. (deprecated in 1.19)(removed in 1.23)
- Article object corresponding to - $wgContLang(removed in 1.36) - Language object associated with the wiki being viewed.
- $wgLang - Language object selected by user preferences.
- $wgLoadBalancer(removed in 1.13) - LoadBalancer object, manages database connections.
- $wgMessageCache(removed in 1.18) - Message cache to manage interface messages.
- $wgOut - OutputPage object for HTTP response.
- $wgParser(deprecated in 1.32) - Parser object. Parser extensions register their hooks here.
- $wgRequest - WebRequest object, to get request data.
- $wgTitle(deprecated in 1.19)
Note: This variable should be avoided when possible, more sane title objects are usually available.
- Title object created from the request URL. - $wgUser - User object for the user associated with the current request.
See also
- Manual:Code
- Manual:Wg variable
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.