Manual:Extension registration/制限事項

This page is a translated version of the page Manual:Extension registration/Limitations and the translation is 25% complete.
Other languages:

拡張機能の登録には既知の制限事項があり、すぐに拡張機能を変換するには適さない場合があります。 意図的なものもあれば、開発者による実装を待っているだけのものもあります :) できないことがある場合は、MediaWiki-Configuration Phabricator プロジェクトにそのバグを報告してください。

  • Configuration settings must have a prefix of "wg" resolved, use a magic "_prefix" key: phab:T97186
  • PHP constants are not supported.

Such constants can either be used for settings within LocalSettings.php, or simply within the extension's code. If it's the latter, you should use class constants instead; these are superior for the same reason that class variables are better than global variables. If it's the former, you unfortunately cannot use either global constants or class constants: global constants can't be set in extension.json, and class constants will get initialized too late to be used. Instead, you should use raw strings, like 'medium' instead of ANIMATION_SPEED_MEDIUM or AnimationExtension::SPEED_MEDIUM. One advantage to this approach is that, if extensions ever get configured via a configuration database (there is a long-term plan for that to happen), strings will be easier to handle than integer constants.

  • You can't use paths to files in extension.json - phab:T100956
  • Conditional namespaces are not supported:

phab:T141604

The workaround for much of this is to use custom registration. If you find something you can't do, create a Phabricator task.