手册:convertExtensionToRegistration.php

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:ConvertExtensionToRegistration.php and the translation is 73% complete.

Other languages:
English • ‎dansk • ‎polski • ‎中文

MediaWiki版本: 1.25
Gerrit change 166705

详情

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 FooBar/FooBar.php until you drop support for those older versions

例子

php maintenance/convertExtensionToRegistration.php extensions/FooBar/FooBar.php

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.

选项

用法:

 php convertExtensionToRegistration.php <path> [<options>]

参数:

 <path>      Location to the PHP entry point you wish to convert

选项:

 --skin      Whether to write to skin.json; use this option for converting a skin!

参见