Manual:Code

This page describes the primary source files (classes) / objects of the MediaWiki code.

index.php

 * on SVN

Main acces point for the MediaWiki software. It handles the most of requests. See Manual:Index.php.

api.php

 * on SVN

External access point for the API, but can also be used internally by other code. See API page for in depth description.

Directory /includes/
This directory stores all files needed by MediaWiki.

Article.php

 * on SVN

In Article.php, e.g. in function outputWikiText, function parse from wgParser is called, which is an instance of class Parser in Parser.php.

Encapsulates access to the revision table etc. of the database. The object represents an article, and maintains state such as text (in wikitext format), flags, etc.

LinkCache.php

 * on SVN

Keeps information on existence of articles. See LINKCACHE.TXT.

Linker.php

 * on SVN

OutputPage.php

 * on SVN

Contains:
 * function output, called from function finalCleanup in Wiki.php. It calls function outputPage in Skin.php.
 * function out, called from function outputPage in Skin.php a number of times, to send the HTML to the user: $mBodytext and HTML before and after it.

This file contains function (deprecated, use addWikiText in Article.php instead!)addPrimaryWikiText which:
 * applies function parse in Parser.php to the wikitext $text, resulting in the HTML text $text
 * applies function addParserOutput to the HTML text $text, which:
 * applies function addHTML to $text, which appends $text to $mBodytext.

Parser.php

 * on SVN (directory "/includes/parser/" since 1.13)

This file defines the parser object used to convert wikitext to HTML. See Manual:Parser.php.

Setup.php

 * on SVN

It included some commonly used files and create the global object variables so that MediaWiki can work. See Manual:Setup.php.

Skin.php

 * on SVN

Encapsulates a "look and feel" for the wiki. All of the functions that render HTML, and make choices about how to render it, are here, and called from various other places when needed.

Contains function outputPage, called from function output in OutputPage.php. Function outputPage calls function out in OutputPage.php a number of times, to send the HTML to the user: $mBodytext and HTML before and after it.

The StandardSkin object is a complete implementation, and is meant to be subclassed with other skins that may override some of its functions. The User object contains a reference to a skin (according to that user's preference), and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser->getSkin.

Title.php

 * on SVN

Represents the title of an article, and does all the work of translating among various forms such as plain text, URL, database key, etc. For convenience, and for historical reasons, it also represents a few features of articles that don't involve their text, such as access rights.

User.php

 * on SVN

Encapsulates the state of the user viewing/using the site. Can be queried for things like the user's settings, name, etc. Handles the details of getting and saving to the user table of the database, and dealing with sessions and cookies.

WebStart.php

 * on SVN

It does the initial setup for a web request: security checks, loads LocalSettings.php and Setup.php. See Manual:WebStart.php.

Wiki.php

 * on SVN

This file consists of the definition of the class MediaWiki. See Manual:Wiki.php.

Directory /languages/
This directory contains files used for internationalisation.

Language.php

 * on SVN

Contains the Language class, it represents the language used for incidental text, and also has some character encoding functions and other locale stuff. Two globals contain an instance of this class: $wgContLang for the site language and $wgLang for the user language.

Directory /maintenance/
This directory contains maintenace scrpits that must be runned from a command line interface.

See Manual:Maintenance scripts for an overwiev of those scripts.

Directory /skins/
This directory contain all skins classes, JavaScripts, CSS and some images used by that skins.