Develop a MediaWiki extension
Releasev0.35.0 · cfeceb67
Watch it in action
Use mw dev mediawiki get-code to add an extension to the checkout used by your selected development context:
mw dev mediawiki get-code --extension CiteThe default Gerrit clone method uses SSH. Configure your Gerrit username first, or use --gerrit-interaction-type http --no-commit-hook for an anonymous public clone when you do not need to push changes.
Fetching the source does not enable the extension. Add it to LocalSettings.php after the shared development settings:
wfLoadExtension( 'Cite' );Run the updater when an extension needs database changes, then run a focused PHPUnit test from its directory:
mw dev mediawiki mwscript updatemw dev mediawiki composer phpunit extensions/Cite/tests/phpunit/unit/CiteParserTagHooksTest.phpIf the test fails, inspect the MediaWiki service logs and repeat the test after the fix:
mw dev compose logs -- --tail=40 mediawikimw dev mediawiki composer phpunit extensions/Cite/tests/phpunit/unit/CiteParserTagHooksTest.phpThe example uses Cite, but the same loop applies to other extensions and skins. Check the extension’s own README for required Composer dependencies, configuration and test commands. See MediaWiki configuration and service management for more details.
Read this guide offline with mw help guides dev extension-workflow.
Page views: —Sessions: —