Jump to navigation Jump to search

This page describes key files and directories in the MediaWiki source code. For more detailed information, see the class, file and comprehensive references auto-generated from the MediaWiki source code using doxygen.


See also: Special:Version#Entry point URLs

注 注: This list can be generated automatically by running: git grep -l /includes/WebStart.php.[AP 1][AP 2]

These are the files that a browser may reach when using the wiki. All of them are located in the root directory of the wiki, and each of them is paired with a .php5 wrapper, for web servers that require the .php5 extension to execute scripts with the PHP5 engine.

ファイル 説明 ウィキ文書
index.php Main access point for the MediaWiki software. It handles most requests made to MediaWiki. Manual:index.php/jaTemplate:Enlink/list1
api.php External access point for MediaWiki's API. See API:Main page. Manual:api.php/jaTemplate:Enlink/list1
load.php Script for the front-end to hook into for loading ResourceLoader modules. Manual:load.php/jaTemplate:Enlink/list1
img_auth.php Script that only serves images to logged in users. To configure the wiki to use that script, see Manual:Image Authorisation. Manual:img_auth.php/jaTemplate:Enlink/list1
opensearch_desc.php Returns an OpenSearch description document that describes the web interface of MediaWiki's search engine. Manual:opensearch_desc.php/jaTemplate:Enlink/list1
profileinfo.php Allow users to see the profiling information that are stored in the database. See Manual:How to debug#Profiling. Manual:profileinfo.php/jaTemplate:Enlink/list1
redirect.php Script that redirects to the article passed in the wpDropdown parameter of the request. Needed for Nostalgia skin Manual:redirect.php/jaTemplate:Enlink/list1
thumb.php Script used to resize images Manual:thumb.php/jaTemplate:Enlink/list1
thumb_handler.php PHP script to be used as 404 handler to create and stream out a not yet existing image thumbnail. Manual:thumb_handler.php/jaTemplate:Enlink/list1
trackback.php Adds trackbacks to the database. Removed in MediaWiki 1.19 (r104051). Manual:trackback.php/jaTemplate:Enlink/list1
  1. Except thumb_handler.php, which is a simple wrapper around thumb.php and thus does not have to re-include WebStart.php
  2. That command also returns mw-config/index.php, but unlike the other files, it is not intended for repeated use during normal wiki operation; in other words, it is not an access point to reach wiki resources, but a one-off script to launch the configuration process of a newly installed wiki.


Default location for the file cache, if enabled (by setting $wgUseFileCache = true; — the default is false.). This location can be customized using $wgFileCacheDirectory.


Contains various text files that should help you understand the most important parts of the code of MediaWiki.


Mediawiki extensions are distributed separately from the core code. Installing an extension entails copying its files into this directory, and enabling it by following the extension's own installation instructions (usually editing the LocalSettings.php file). In current versions a set of several extensions is distributed with a fresh MediaWiki install.


This directory stores common include files needed by MediaWiki.

ファイル 説明 ウィキ文書
includes/Article.php Contains the Article class, which provides methods to view, modify and manage articles. This maintains WikiPage functions for backwards compatibility. Manual:Article.php/jaTemplate:Enlink/list1
includes/Defines.php Defines several constants, suchs as those for namespaces, which are used by other files and classes. Manual:Defines.php/jaTemplate:Enlink/list1
includes/EditPage.php Provides much of the code related to the editing user interface Manual:EditPage.php/jaTemplate:Enlink/list1
includes/GlobalFunctions.php Contains globally used functions like wfMsgExt. Manual:GlobalFunctions.php/jaTemplate:Enlink/list1
includes/Linker.php Contains methods to create internal, external or image links and implements page existence detection. Manual:Linker.php/jaTemplate:Enlink/list1
includes/Message.php Provides methods for: fetching interface messages; processing messages into a variety of formats. See Manual:Messages API. Manual:Message.php/jaTemplate:Enlink/list1
includes/OutputPage.php Hold HTML and wikitext parsing. Will also generate the <head> element or part of it. Manual:OutputPage.php/jaTemplate:Enlink/list1
includes/Pager.php Contains the IndexPager class used for paging results of MySQL queries. Manual:Pager.php/jaTemplate:Enlink/list1
includes/Parser.php Contains most of the code that converts wikitext to HTML (though few bits and pieces are in Manual:Skin.php). Manual:Parser.php/jaTemplate:Enlink/list1
includes/Setup.php Include commonly used files and initializes the global object variables so that MediaWiki can work. Manual:Setup.php/jaTemplate:Enlink/list1
includes/Skin.php Encapsulates a "look and feel" for the wiki. Manual:Skin.php/jaTemplate:Enlink/list1
includes/SpecialPage.php Contains the SpecialPage class, which is the parent class for all special page classes. It also makes available several static functions for handling the special page list and several other special page classes, like RedirectSpecialPage and IncludableSpecialPage. See Manual:Special pages. Manual:SpecialPage.php/jaTemplate:Enlink/list1
includes/SiteStats.php Contains the SiteStats class for site statistics and related things. Manual:SiteStats.php/jaTemplate:Enlink/list1
includes/Title.php 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. Manual:Title.php/jaTemplate:Enlink/list1
includes/User.php 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. Manual:User.php/jaTemplate:Enlink/list1
includes/UserMailer.php Collection of static functions for sending mail. Manual:UserMailer.php/jaTemplate:Enlink/list1
includes/WebRequest.php This file contains the definition of the WebRequest class. Manual:WebRequest.php/jaTemplate:Enlink/list1
includes/WebStart.php It does the initial setup for a web request: security checks, loads LocalSettings.php and Setup.php. Manual:WebStart.php/jaTemplate:Enlink/list1
includes/MediaWiki.php This file consists of the definition of the class MediaWiki. Manual:MediaWiki.php/jaTemplate:Enlink/list1
includes/PathRouter.php The class used for turning pretty urls into query arguments that MediaWiki can use. Manual:PathRouter.php/jaTemplate:Enlink/list1
includes/WikiPage.php Contains the WikiPage class, which represents a page in the wiki. Manual:WikiPage.php/jaTemplate:Enlink/list1


This directory contains the Action classes, which handle the different actions which can be performed on pages (e.g. view, delete, edit, etc.). All these classes extend the Action, FormlessAction or FormAction classes. Some of them are just stubs which call methods in the Article or EditPage classes to do the actual work.

ファイル 説明 ウィキ文書
includes/actions/CreditsAction.php Handles formatting the credits for articles. See also Manual:$wgMaxCredits/ja. Manual:CreditsAction.php/jaTemplate:Enlink/list1
includes/actions/DeleteAction.php Handles page deletion. Manual:DeleteAction.php/jaTemplate:Enlink/list1
includes/actions/EditAction.php Contains classes EditAction and SubmitAction which handle the edit and submitting actions. Manual:EditAction.php/jaTemplate:Enlink/list1
includes/actions/HistoryAction.php Handles printing the history page for an article. Manual:HistoryAction.php/jaTemplate:Enlink/list1
includes/actions/InfoAction.php Displays informations about a page, like the total number of edits and number of unique editors. Manual:InfoAction.php/jaTemplate:Enlink/list1
includes/actions/MarkpatrolledAction.php Handles marking a revision as patrolled. Manual:MarkpatrolledAction.php/jaTemplate:Enlink/list1
includes/actions/ProtectAction.php Handles protecting a page. Manual:ProtectAction.php/jaTemplate:Enlink/list1
includes/actions/PurgeAction.php Handles purging a page. Manual:PurgeAction.php/jaTemplate:Enlink/list1
includes/actions/RawAction.php Handles the "action=raw" action. Manual:RawAction.php/jaTemplate:Enlink/list1
includes/actions/RenderAction.php Handles the render action, which shows an HTML rendering of the page; similar to the view action, but only the unstyled article text is shown, not the additional toolboxes, search boxes, stylesheets, etc. Manual:RenderAction.php/jaTemplate:Enlink/list1
includes/actions/RevertAction.php Contains class RevertFileAction, which handles reverting a file. Manual:RevertAction.php/jaTemplate:Enlink/list1
includes/actions/RevisiondeleteAction.php Handles the revision delete action by just passing the request to Special:RevisionDelete. Manual:RevisiondeleteAction.php/jaTemplate:Enlink/list1
includes/actions/RollbackAction.php Handles rolling back a page. Manual:RollbackAction.php/jaTemplate:Enlink/list1
includes/actions/ViewAction.php Handles the viewing of a page, by calling Article::view(). Manual:ViewAction.php/jaTemplate:Enlink/list1
includes/actions/WatchAction.php Contains classes WatchAction and UnwatchAction, which handle watching and unwatching a page. Manual:WatchAction.php/jaTemplate:Enlink/list1


This directory contains the code for the MediaWiki API. See API:Main page. The most important files are:

ファイル 説明 ウィキ文書
includes/api/ApiBase.php The base class for all API classes. Has a lot of common code for all API actions. Inherits class ContextSource Manual:ApiBase.php/jaTemplate:Enlink/list1
includes/api/ApiFormatBase.php The base class for all formatting classes. Inherits ApiBase. Manual:ApiFormatBase.php/jaTemplate:Enlink/list1
includes/api/ApiQueryBase.php The base class for all query API classes. Inherits ApiBase. Manual:ApiQueryBase.php/jaTemplate:Enlink/list1


This directory contains files with code relating to MediaWiki's caching mechanisms.

ファイル 説明 ウィキ文書
cache/FileCacheBase.php The FileCacheBase class is the base class for classes which provide a file based cache scheme. See Manual:File cache. Manual:FileCacheBase.php/jaTemplate:Enlink/list1
cache/GenderCache.php Caches user genders when needed to use correct namespace aliases. Manual:GenderCache.php/jaTemplate:Enlink/list1
cache/HTMLCacheUpdate.php Invalidates the HTML cache of all the pages linking to a given title. Manual:HTMLCacheUpdate.php/jaTemplate:Enlink/list1
HTMLFileCache.php File based caching of HTML pages. Manual:HTMLFileCache.php/jaTemplate:Enlink/list1
cache/LinkBatch.php The LinkBatch class represents a list of titles. Manual:LinkBatch.php/jaTemplate:Enlink/list1
cache/LinkCache.php Caching for article titles (prefixed DB keys) and ids linked from one source. See also LINKCACHE.TXT. Manual:LinkCache.php/jaTemplate:Enlink/list1
cache/MemcachedSessions.php This file gets included if $wgSessionsInMemcache is set in the config. It redirects session handling functions to store their data in memcached instead of the local filesystem. Manual:MemcachedSessions.php/jaTemplate:Enlink/list1
cache/MessageCache.php Performs various MediaWiki namespace-related functions. Manual:MessageCache.php/jaTemplate:Enlink/list1
cache/ObjectFileCache.php File based caching of objects. Manual:ObjectFileCache.php/jaTemplate:Enlink/list1
cache/ResourceFileCache.php File based caching of JavaScript and CSS resources. Manual:ResourceFileCache.php/jaTemplate:Enlink/list1
cache/SquidUpdate.php Handles purging appropriate Squid URLs given a title (or titles). Manual:SquidUpdate.php/jaTemplate:Enlink/list1


This directory contains a few classes related to (request) contexts. As of MediaWiki 1.18 the context of a request is encapsulated inside a RequestContext instance which implements IContextSource. A context is a way of grouping the parts of a request together. This reduces the need for globals. See Manual:RequestContext.php for more information.

ファイル 説明 ウィキ文書
includes/context/ContextSource.php The ContextSource class implements the IContextSource interface. It is a helper class: by making a class extend ContextSource the class will be provided with the various getOutput, getSkin, getLanguage, etc. helpers directly and will implement IContextSource. Manual:ContextSource.php/jaTemplate:Enlink/list1
includes/context/DerivativeContext.php A DerivativeContext is an IContextSource implementation which will inherit context from another source but allows individual pieces of context to be changed locally. Manual:DerivativeContext.php/jaTemplate:Enlink/list1
includes/context/IContextSource.php This file contains the IContextSource interface. This interface should be implemented by objects which provide a context on a request. Manual:IContextSource.php/jaTemplate:Enlink/list1
includes/context/RequestContext.php A RequestContext object groups all the pieces relevant to the context of a request into one instance. Manual:RequestContext.php/jaTemplate:Enlink/list1


This directory contains the code for database support. Database.php provides MediaWiki's database abstraction layer.


This directory contains the standard MediaWiki difference engine. A difference engine computes the difference between two texts. Whether this difference engine is used or some external diff tool, depends on the $wgExternalDiffEngine setting.

ファイル 説明 ウィキ文書
includes/diff/DairikiDiff.php The DairikiDiff engine. Currently the standard diff engine. The file defines several related classes. Manual:DairikiDiff.php/jaTemplate:Enlink/list1
includes/diff/DifferenceEngine.php The DifferenceEngine class the interface between MediaWiki and whichever difference engine is used. Which difference engine is used depends on the $wgExternalDiffEngine config setting. Manual:DifferenceEngine.php/jaTemplate:Enlink/list1
includes/diff/WikiDiff3.php Another diff engine. Currently not in use. Manual:WikiDiff3.php/jaTemplate:Enlink/list1


Files related to the job queue. Each job class for a specific type of job derives from the Job class and has to implement a run() method which does the actual job.

ファイル 説明 ウィキ文書
includes/job/DoubleRedirectJob.php Job to fix double redirects after moving a page Manual:DoubleRedirectJob.php/jaTemplate:Enlink/list1
includes/job/EnotifNotifyJob.php Job for email notification. Manual:EnotifNotifyJob.php/jaTemplate:Enlink/list1
includes/job/JobQueue.php Contains the Job class. This is the abstract class to describe a background job. The class also contains static functions for handling jobs (insert jobs in the queue and pop jobs from the queue). Manual:JobQueue.php/jaTemplate:Enlink/list1
includes/job/RefreshLinksJob.php Contains the RefreshLinksJob and RefreshLinksJob2 classes for jobs to update links for a given title. They use class LinksUpdate (defined in /includes/LinksUpdate.php) to update several db tables. Manual:RefreshLinksJob.php/jaTemplate:Enlink/list1
includes/job/UploadFromUrlJob.php Job for asynchronous upload-by-url. Its an interface to the UploadFromUrl class in /includes/upload/UploadFromUrl.php. Manual:UploadFromUrlJob.php/jaTemplate:Enlink/list1


Some files related to logging the events which happen on a Wiki. This directory was introduced in MW 1.19. Some of the files were already present in olders versions, in the includes/ directory.

ファイル 説明 ウィキ文書
includes/logging/LogEntry.php Contains the LogEntry interface and some classes implementing this interface to encapsulate log entries. Introduced in MW 1.19. Manual:LogEntry.php/jaTemplate:Enlink/list1
includes/logging/LogEventsList.php A class to list log entries. Manual:LogEventsList.php/jaTemplate:Enlink/list1
includes/logging/LogFormatter.php Contains several classes for formatting log entries. Introduced in MW 1.19. Manual:LogFormatter.php/jaTemplate:Enlink/list1
includes/logging/LogPage.php Class to manage a log: add entries to the log and extract information from the log. Manual:LogPage.php/jaTemplate:Enlink/list1
includes/logging/LogPager.php Class to list log entries. Implements the ReverseChronologicalPager class. Manual:LogPager.php/jaTemplate:Enlink/list1
includes/logging/PatrolLog.php Class containing static functions for working with logs of patrol events. Manual:PatrolLog.php/jaTemplate:Enlink/list1


This directory contains files for handling several media formats, mostly images.


This directory contains some Unicode normalization routines. See includes/normal/README for more information.


Files related to MediaWiki's caching mechanisms. The files in this directory provide the possibility to store objects in PHP accelerators, in memcached, in a database or in DBA files.

ファイル 説明 ウィキ文書
includes/objectcache/APCBagOStuff.php Implementation of BagOStuff for APC's shared memory functions. Manual:APCBagOStuff.php/jaTemplate:Enlink/list1
includes/objectcache/BagOStuff.php Abstract class to be derived by classes which cache objects in PHP accelerators, SQL database or DBA files. It specifies the methods a cache class must provide, like get(), set(), delete(), etc. Manual:BagOStuff.php/ja /en
includes/objectcache/DBABagOStuff.php Implementation of BagOStuff which uses PHP's DBA extension as a backend. Manual:DBABagOStuff.php/ja /en
includes/objectcache/EhcacheBagOStuff.php Implementation of BagOStuff using the Ehcache RESTful web service. Manual:EhcacheBagOStuff.php/ja /en
includes/objectcache/EmptyBagOStuff.php Emulates an empty BagOStuff. Manual:EmptyBagOStuff.php/ja /en
includes/objectcache/MemcachedClient.php Contains the MWMemcached class, a PHP memcache client. Manual:MemcachedClient.php/ja /en
includes/objectcache/MemcachedPhpBagOStuff.php Implementation of BagOStuff using memcached. It uses the MWMemcached class as a pure PHP memcached client. Manual:MemcachedPhpBagOStuff.php/ja /en
includes/objectcache/MultiWriteBagOStuff.php Implementation of BagOStuff that replicates all writes to multiple child caches. Manual:MultiWriteBagOStuff.php/ja /en
includes/objectcache/ObjectCache.php The ObjectCache class contains some static helper functions for caching objects. Manual:ObjectCache.php/ja /en
includes/objectcache/SqlBagOStuff.php Implementation of BagOStuff using a database. Manual:SqlBagOStuff.php/ja /en
includes/objectcache/inCacheBagOStuff.php Implementation of BagOStuff using WinCache. Manual:inCacheBagOStuff.php/ja /en
includes/objectcache/CacheBagOStuff.php Implementation of BagOStuff using XCache. Manual:CacheBagOStuff.php/ja /en


The MediaWiki parser, which transforms wikitext to HTML, can be found here together with related files. The most interesting files in this directory:

ファイル 説明 ウィキ文書
includes/parser/CoreParserFunctions.php A collection of functions which implement the core parser functions. Manual:CoreParserFunctions.php/jaTemplate:Enlink/list1
includes/parser/CoreTagHooks.php Tag hooks provided by MediaWiki core, e.g. <nowiki>, <gallery>, <pre>, .. Manual:CoreTagHooks.php/jaTemplate:Enlink/list1
includes/parser/LinkHolderArray.php A LinkHolderArray holds a set of replacement pairs for wiki links. Manual:LinkHolderArray.php/jaTemplate:Enlink/list1
includes/parser/Parser.php This file contains the parser. A few regular expressions are included. Manual:Parser.php/jaTemplate:Enlink/list1
includes/parser/ParserCache.php This class handles caching the output from the parser. Manual:ParserCache.php/ja /en
includes/parser/ParserOptions.php The ParserOptions class holds a collection of options for the parser. Manual:ParserOptions.php/jaTemplate:Enlink/list1
includes/parser/ParserOutput.php Contains the ParserOutput class, which encapsulates the output of the parser. Manual:ParserOutput.php/ja /en
includes/parser/Preprocessor.php Contains the Preprocessor interface for preprocessors. Also contains the PPFrame and PPNode interfaces. Manual:Preprocessor.php/jaTemplate:Enlink/list1
includes/parser/Preprocessor_DOM.php A preprocessor using PHP's DOM extension. This preprocessor is used if the PHP DOM extension is available. Manual:Preprocessor_DOM.php/jaTemplate:Enlink/list1
includes/parser/Preprocessor_Hash.php A preprocessor using PHP arrays. This preprocessor is used if the PHP DOM isn't available or when the old XMLDOM extension is present. Manual:Preprocessor_Hash.php/ja /en
includes/parser/Preprocessor_HipHop.php A preprocessor optimised for HipHop, using HipHop-specific syntax. Manual:Preprocessor_HipHop.php/ja /en


Files related to ResourceLoader, a JavaScript/CSS delivery optimizing system for MediaWiki.


This directory contains the code to implement the possibility of searching a wiki using one the possible backends.

ファイル 説明 ウィキ文書
includes/search/SearchEngine.php Contains several classes related to searching a wiki. The SearchEngine class is the parent class for specific search implementations. Manual:SearchEngine.php/jaTemplate:Enlink/list1
includes/search/SearchIBM_DB2.php Implements SearchEngine using IBM DB2. Manual:SearchIBM_DB2.php/ja /en
includes/search/SearchMssql.php Implements SearchEngine using Msssql. Manual:SearchMssql.php/ja /en
includes/search/SearchMySQL.php Implements SearchEngine using a MySQL search engine. Manual:SearchMySQL.php/ja /en
includes/search/SearchOracle.php Implements SearchEngine using Oracle (ConText). Manual:SearchOracle.php/ja /en
includes/search/SearchSqlite.php Implements SearchEngine using SQLite. Manual:SearchSqlite.php/ja /en


This directory contains the code and classes for the standard special pages. All special page classes derive from class SpecialPage (defined in includes/SpecialPage.php). Special pages which come with extension are located in their respective extensions directories. See also Manual:Special pages.


Files providing the backend of MediaWiki's file upload feature.

ファイル 説明 ウィキ文書
includes/upload/UploadBase.php UploadBase and subclasses are the backend of MediaWiki's file uploads. Manual:UploadBase.php/jaTemplate:Enlink/list1
includes/upload/UploadFromChunks.php Subclass of UploadBase implementing uploading from chunks. Manual:UploadFromChunks.php/jaTemplate:Enlink/list1
includes/upload/UploadFromFile.php Subclass of UploadBase implementing regular file uploads. Manual:UploadFromFile.php/jaTemplate:Enlink/list1
includes/upload/UploadFromStash.php Subclass of UploadBase implementing uploading from previously stored file. Manual:UploadFromStash.php/ja /en
includes/upload/UploadFromUrl.php Subclass of UploadBase implementing uploading from a HTTP resource. Manual:UploadFromUrl.php/ja /en
includes/upload/UploadStash.php Provides the possibility to enable applications to temporarily stash files without publishing them to the wiki. Manual:UploadStash.php/ja /en


If uploads are enabled in the wiki, files will be put in subdirectories under this directory. See Manual:Image administration#Folders for more details.


This directory contains files used for localization and internationalization. For a quick overview, see Language in MediaWiki.

ファイル 説明 ウィキ文書
languages/Language.php 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. Manual:Language.php/ja /en


This directory contains maintenance scripts that must be run from a command line interface.

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


Entry point for the Config script (the helper script that helps setting up a newly installed wiki). The actual code of the installer is located at /includes/installer/.


This directory contains JavaScript and CSS resources used by MediaWiki, including jQuery.

It also contains binary files like PNG and SVG images, for instance in resources/src/mediawiki/images/: see Manual:Assets.


Location for serialized objects (database entries converted into files -- see Serialization for more information). The database tables that contain serialized data are listed at Manual:Serialization.


This directory contain all skins classes, JavaScripts, CSS and some images used by that skins. See Manual:Skins.


Contains various (unit)test related files, including:

言語: English  • Deutsch • français • Bahasa Indonesia • 日本語 • português do Brasil • русский • 中文