Manual:Extension registration/Migration/ja



拡張機能開発者向けの移行手順


名前空間ID
MediaWikiのバージョン1.30以降では、拡張機能を読み込む前に  でそれぞれの定数を定義することにより   で定義された名前空間IDをローカルで上書きできます. 例えば、 のファイルで以下の名前空間宣言を行うことを検討してください:

This would per default cause the constant NS_FOO to be defined to have the value 1212. ただし、LocalSettings.php 内で対応する定数を定義することでこれを上書きできます:

これにより、「Foo」名前空間が 1212 ではなく 6688 の ID で登録されます. 名前空間の ID をオーバーライドする際は、すべてのトーク名前空間が奇数の ID を持つ必要があり、トーク名前空間の ID は常に (トークページに紐づく) 対象名前空間の ID に 1 を加えたものでなければならないことを忘れないでください.


 * extension registration wall of sadness (現在は wall of superpowers) も参照してください. 

The script  helps you migrating from PHP entry points to a JSON metadata file. If your extension supports older versions of MediaWiki, you should keep your PHP entry point  until you drop support for those older versions.

Sample command lines:

You may need to uninstall your extension from  if you receive errors that constants or functions cannot be redefined. You should replace your PHP entry point file (FooBar.php) with something like the following happens to not break wikis during the upgrade process.

Or skins

Retaining documentation
PHP entry points usually have some documentation of configuration settings that is useful and shouldn't be lost. Unfortunately JSON doesn't support comments. It is recommended that you transfer configuration documentation to a  file in the extension's repository. You should also document configuration on-wiki in your Extension:MyExtension page. It is possible to include some documentation directly in the  file as well. Extension registration ignores any key in  starting with ' ' in the top-level structure, so you can put comments in those parts of the JSON file. For example:

Version 1 of the  format also allowed   in   section, but this is no longer recommended or supported in version 2. field of the config variable should be used instead.

This should only be used for brief notes and comments.