Manual:Wiki.php

From MediaWiki.org

Jump to: navigation, search
MediaWiki File: Wiki.php
Location: /includes/
Source code: HEAD

1.13.21.12.11.6.10

Classes: MediaWiki

[edit] Description

Among other things this file contains:

  • Function checkInitialQueries which creates a Title object depending on the title parameter passed to index.php. If the oldid parameter is passed, it will override the title if it's not a special page.
  • Function initialize which does the most of the work. It calls:
    • preliminaryChecks
    • initializeSpecialCases, and if that function return false:
    • initializeArticle
    • performAction if initializeArticle returned an article
  • Function preliminaryChecks which checks that the page can be seen by the current, and output an error if not.
  • Function initializeSpecialCases (called by initialize) it returns true if it matched a special case (see the list below) and false if the request should continue. Special cases handled by this function:
    • Invalid title
    • Redirects to interwikis links
    • Local redirects if, e.g., no title parameter passed to index.php, ...
    • Special pages
  • Function initializeArticle, which creates an Article object from the Title given. Then it checks if it is a redirect and if it's the case, recreate another Article from the target of the redirect and changes $wgTitle and $wgArticle. It can return either:
    • An article object, which will be passed performAction to execute the requested action
    • A string if it's an interwiki redirect or a redirect to a special page
  • Function performAction (called by initialize) which performs most actions, including creating the HTML. For example, in the case of viewing a page, function "view" in Article.php is called.
  • Function finalCleanup (called by index.php) which does the following:
    • Deferred updates
    • Jobs
    • Flushes out all HTML by calling OutputPage::output() .

[edit] Hooks

[edit] See also

Personal tools