Manual:convertExtensionToRegistration.php

From Linux Web Expert

Revision as of 00:22, 10 June 2023 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.25
Gerrit change 166705
<translate> MediaWiki version:</translate>

詳細

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 <translate> Required</translate>
--skin Whether to write to skin.json; use this option for converting a skin! <translate> Optional</translate>
--config-prefix Custom prefix for configuration settings <translate> Optional</translate>

使用法

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

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.

関連項目