[go: up one dir, main page]

Jump to content

Manual:Index.php: Difference between revisions

From mediawiki.org
Content deleted Content added
normalize documentation around "access point" rather than "entry point" nomenclature (see mailarchive:wikitech-l/2013-March/067409.html)
No edit summary
Line 1: Line 1:
{{MW file|index.php}}
{{MW file|index.php}}


'''Index.php''' is the main access point for a MediaWiki site. The other main access point is [[Manual:api.php|api.php]] which handles requests for the MediaWiki [[API]].
'''aIndex.php''' is the main access point for a MediaWiki site. The other main access point is [[Manual:api.php|api.php]] which handles requests for the MediaWiki [[API]].


== Actions taken==
== Actions taken==

Revision as of 14:30, 14 August 2014

aIndex.php is the main access point for a MediaWiki site. The other main access point is api.php which handles requests for the MediaWiki API.

Actions taken

Most requests result in the following actions in index.php:

  1. First, it includes WebStart.php (SVN), which includes LocalSettings.php and Setup.php (SVN).
  2. Next it instantiates a MediaWiki object called $mediaWiki which is defined in Wiki.php.
  3. It then checks the maxlag parameter, which may cause the request to be rejected.
  4. It calls the function MediaWiki::checkInitialQueries() in Wiki.php, which creates a Title object depending of the title and action parameters from the URL.
  5. If ajax is enabled and the action parameter is set to ajax, then an AjaxDispatcher object will be created to handle that request and the script will stop after that.
  6. Otherwise some globals are stored in $mediaWiki to be used in the next steps.
  7. It calls MediaWiki::initialize() which does most of the work of the request.
  8. Then MediaWiki::finalCleanup() is called. That function does the deferred updates, runs jobs from the queue depending on $wgJobRunRate and outputs the HTML by calling OutputPage::output().
  9. Finally, MediaWiki::restInPeace() is called to log profiling data.

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:

  1. Check the version of PHP and if its not 5.2.3 or higher, display an error.
  2. Include WebStart.php (SVN), which in turn includes LocalSettings.php, Setup.php (SVN) and some other files.
  3. Instantiate a MediaWiki object called $mediaWiki, which is defined in Wiki.php.
  4. Call $mediaWiki->run().

See also