Release status: stable
|Description||Boilerplate code ready to be substituted to create a new extension with the latest standards and structure in place.|
|License||GNU General Public License 2.0 or later|
Translate the BoilerPlate extension if it is available at translatewiki.net
|Check usage and version matrix; code metrics|
The BoilerPlate extension is a blank extension template. It doesn't really do anything on its own. It provides boilerplate code for an actual MediaWiki extension. It also implements MediaWiki's preferred #Test automation and continuous integration, see that section below.
Usage[edit | edit source]
To use it, enter the following commands to make a clean directory of just the BoilerPlate source code without the Git meta-data and other examples. (Substitute your extension's name for MyExtension.)
cd extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BoilerPlate.git cp -R BoilerPlate ./MyExtension
Then in MyExtension
- rename BoilerPlate files to MyExtension.
BoilerPlatevariable names, preserving case (i.e. boilerPlate -> myExtension).
- replace "Your Name" in skin.json with your name
Test automation and continuous integration[edit | edit source]
Installation[edit | edit source]
If you want to install this dull extension on your wiki to see if it works or troubleshoot problems with your adaptation.
- Download and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'BoilerPlate' );
- visit Special:HelloWorld to verify the extension is working
- follow the steps in its README to install testing dependencies, then run npm test and composer test
- Special:Version on your wiki to verify that the extension is successfully installed. Done - Navigate to
To users running MediaWiki 1.24 or earlier:
The instructions above describe the new way of installing extensions using
wfLoadExtension(), since MediaWiki 1.25. If you need to install this extension in earlier versions, instead of
wfLoadExtension( 'BoilerPlate' );, you need to use:
(To run an extension on an earlier release, you may need to download the version of it tagged for that release from Special:ExtensionDistributor.)
Earlier MediaWiki releases[edit | edit source]
If you want your extension to be compatible with earlier MediaWiki releases, consult the source code of release branches of the Example extension.