MediaWiki version:
1.25
Gerrit change 166705
MediaWiki file: convertExtensionToRegistration.php
Location: maintenance/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: ConvertExtensionToRegistration

Details

convertExtensionToRegistration.php is a maintenance script, which helps you migrating extensions and skins from PHP entry points to a JSON metadata file named extension.json or skin.json. If your extension supports older versions of MediaWiki, you should keep your PHP entry point {{tmpl|0=$1/$2.php|DirName|FileName}} until you drop support for those older versions.

Options/Arguments

Option/Argument Description Required?
<path> Location to the PHP entry point you wish to convertRequired
--skin Whether to write to skin.json; use this option for converting a skin! Optional
--config-prefix Custom prefix for configuration settingsOptional

Usage

php maintenance/convertExtensionToRegistration.php <path> [ --skin| --config-prefix ]
Terminal
$ php maintenance/convertExtensionToRegistration.php extensions/FooBar/FooBar.php

Wrote output to extensions/FooBar/extension.json

This detects many variable declarations in the entry point FooBar.php and converts them into settings in an extension.json file. Afterwards, you might still want to manually clean up these declarations inside the FooBar.php file and add a call to wfLoadExtension() as detailed on Manual:Extension registration#Migration for extension developers.

See also

  • Migration for extension developers
  • extension.json Schema
  • validateRegistrationFile.php
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.