Manual:convertExtensionToRegistration.php
Appearance
From mediawiki.org
This page is a translated version of the page Manual:ConvertExtensionToRegistration.php and the translation is 53% complete.
Languages:
MediaWiki バージョン:
≧ 1.25
Gerrit change 166705
| MediaWiki ファイル: convertExtensionToRegistration.php | |
|---|---|
| 場所: | maintenance/ |
| ソース コード: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| クラス: | ConvertExtensionToRegistration |
詳細
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 DirName/FileName.php until you drop support for those older versions.
オプション/引数
| オプション/引数 | 説明 | 必須かどうか |
|---|---|---|
| <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!
|
省略可能 |
| --config-prefix | Custom prefix for configuration settings | 省略可能 |
使用法
phpmaintenance/run.phpconvertExtensionToRegistration<path>[--skin|--config-prefix]
Terminal
$ php maintenance/run.php convertExtensionToRegistration 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.
MediaWiki バージョン 1.43.6 以前では、メンテナンス スクリプトを
php maintenance/run.php スクリプト名 ではなく php maintenance/スクリプト名.php を使用して実行する必要があります。