Developer hub
This is a high-level overview of MediaWiki development, including links to the key documents, resources and tools available to MediaWiki developers. It is written for skilled LAMP developers who have experience using MediaWiki.
- If you want to use Wikimedia web APIs, visit the Developer Portal.
- If you want to contribute to developing Wikimedia software, see New Developers .
- For an introductory guide to developing MediaWiki and MediaWiki extensions, read How to become a MediaWiki hacker .
- If you want to collaborate with other third-party MediaWiki users, the MediaWiki Stakeholders' Group (MWStake) is a MediaWiki user group consisting of MediaWiki developers, system administrators, users, consultants, and hosting providers.
Overview
MediaWiki is the software that powers Wikipedia, its sister projects and thousands of wikis all over the world.
MediaWiki is written in the PHP programming language.[1] It uses jQuery as the client JavaScript library.
MediaWiki is primarily written for the LAMP platform[2] and runs on most operating systems. MediaWiki primarily uses the MySQL and MariaDB database servers.[3]
Development happens in an open source style[4], is largely coordinated online, and supported by the Wikimedia Foundation, though volunteer community developers play a huge part as well.
- Development discussion happens on various mailing lists and IRC channels. The main developer list is wikitech-l. The main developer IRC channel is #mediawiki connect.
- Source code is managed using the Git version control system.[5]
- Code review for most projects is performed on Gerrit . Follow this tutorial to set up Git and Gerrit in order to submit patches.
- Bug reports and tasks for most projects are managed on Phabricator .
- Developers extending or interfacing with MediaWiki (instead of working on the core code) have several convenient extension points, including the API, the Hooks system and Skins – see the #Extending MediaWiki section of this page for an overview.
Key documents
Code, development and style
- Development policy – an overview of key development policies.
- Coding conventions – learn how to write code in the MediaWiki style.
- Security for developers – learn how to help keep MediaWiki secure.
- Manual:Pre-commit checklist – read this checklist before committing code.
- Code review guide – a guide for reviewers of commits to the MediaWiki source code.
- Technical Decision Making Process – read about the process to decide on making larger technical changes.
Debugging and testing
- How to debug – a guide to debugging MediaWiki.
- Manual:Errors and symptoms – an overview of common MediaWiki errors and their correlating symptoms.
- Browser testing – learn to write UI tests for MediaWiki using Selenium.
- Unit testing – learn to write unit tests for MediaWiki using PHPUnit.
- API integration tests – learn to write API integration tests for MediaWiki using Mocha.
- Security for developers – learn how to write secure code.
Architecture
- MediaWiki architecture – an introduction to MediaWiki's architecture.
- Manual:Code – an overview of the key parts of MediaWiki's source code.
- Manual:Database layout – an overview of MediaWiki's database schemas.
- Manual:Global object variables – a partial list of key global variables.
- Localisation – learn about MediaWiki's internationalisation system.
- Manual namespace on this wiki – documentation for developers.
- MediaWiki Class Reference – technical documentation generated from the MediaWiki source code. (Note: The class reference is a large, slow-to-load page.)
Sub-systems
- API – MediaWiki's API provides direct, high-level access to the data contained in the MediaWiki databases.
- ContentHandler – MediaWiki's framework for supporting custom types of page content.
- Database access – an overview of using databases in MediaWiki, including a brief guide to the database abstraction layer.
- Job queue – MediaWiki's framework for processing long-running tasks asynchronously.
- Messages API – MediaWiki's framework for providing localized application messages with PHP or JavaScript.
Extending MediaWiki
MediaWiki has been designed to allow for modification without changing the "core code". This makes it easy to update to a new version of MediaWiki without having to manually merge in old extension code changes. There are six main extension points that allow developers to change or extend what MediaWiki can do. The extension points are:
- API – access the data and metadata of MediaWiki instances through its web API.
- Hooks – every time a given event happens, do something.
- Parser functions – create a new command like:
{{#if:...|...|...}}
. - Skins – change the look and feel of MediaWiki.
- Special pages – add a new special page.
- Tag extensions – create a new tag like:
<newtag>...</newtag>
. - Extending wiki markup – add a parser hook to modify the content of wikitext.
Help for extension developers
- Manual:Developing extensions – a guide to developing extensions.
- Extensions FAQ
- See Category:Extensions , for a list of extensions.
- Extension:BoilerPlate - a blank extension template.
Help for skin developers
- Manual:How to make a MediaWiki skin – instructions on how to create a skin for MediaWiki.
- Manual:Skin configuration – a guide to configuring skins for a wiki.
Help for library code reuse
- Manual:Developing libraries – a guide to packaging third-party libraries for use with MediaWiki
Notes
- ↑ Not all of MediaWiki is written in PHP. Some supporting tools are written in other languages, including batch files, shell scripts, makefiles and Python.
- ↑ MediaWiki runs on most platforms that can support PHP, however, the lack of certain utilities or operating system features may limit the functionality or performance of MediaWiki on non-LAMP platforms.
- ↑ MediaWiki has support for DBMS other than MySQL and MariaDB, including PostgreSQL and SQLite.
- ↑ Developers are a mix of volunteers and paid staff (or contractors) for various organizations. For a full list of who works on the MediaWiki code, read the Developers article.
- ↑ Browse the source code and revisions of code repositories in Gerrit or download the source code to your system by using Gerrit .