Manual:index.php
From MediaWiki.org
| MediaWiki File: index.php | |
|---|---|
| Location: | / |
| Source code: | |
| Classes: | None |
[edit] Description
Main entry point for the MediaWiki software. It handles most requests for wiki pages. The other main entry point is api.php which handles requests for the MediaWiki API. Most requests result in the following actions in index.php:
- First, it includes WebStart.php (SVN), which includes LocalSettings.php and Setup.php (SVN).
- Next it instantiates a MediaWiki object called $mediaWiki which is defined in Wiki.php.
- It then checks the maxlag parameter, which may cause the request to be rejected.
- It calls the function
MediaWiki::checkInitialQueries()in Wiki.php, which creates a Title object depending of the title and action parameters from the URL. - If ajax is enabled and the
actionparameter is set toajax, then an AjaxDispatcher object will be created to handle that request and the script will stop after that. - Otherwise some globals are stored in $mediaWiki to be used in the next steps.
- It calls
MediaWiki::initialize()which does most of the work of the request. - Then
MediaWiki::finalCleanup()is called. That function does the deferred updates, runs jobs from the queue depending on $wgJobRunRate and outputs the HTML by callingOutputPage::output(). - Finally,
MediaWiki::restInPeace()is called to log profiling data.
[edit] Version 1.18 and higher
As of MediaWiki version 1.18, some of the startup logic has been moved from index.php, and index.php performs the following actions:
- Check the version of PHP and if its not 5.2.3 or higher, display an error.
- Include WebStart.php (SVN), which in turn includes LocalSettings.php, Setup.php (SVN) and some other files.
- Instantiate a MediaWiki object called $mediaWiki, which is defined in Wiki.php.
- Call
$mediaWiki->run().
[edit] See also
| Language: | English • Français • 日本語 • 中文(简体) • 中文(繁體) |
|---|