Extension:BetaFeatures/ja

BetaFeatures拡張機能は他のMediaWiki拡張機能がウィキ上の個人設定のリストにベータ機能を登録することを可能にします. 既存の個人設定アーキテクチャといくつかの特別ページを使用してその機能を実現します.

Using the new hooks in your extension
この拡張機能を使用してベータ機能をサポートするのは簡単です. 拡張機能のメインファイルに「GetBetaFeaturePreferences」タイプのフックを登録する - 構文はGetPreferences hookとほとんど同じですが、この場合に必要な設定の種類を少し変更してサポートしています.

Then, you can use the convenience function provided by BetaFeatures to check whether the feature is enabled.

You can also use a normal preference check, but don't check against truthy or falsy values - use the values from the HTMLFeatureField class.

Because the BetaFeatures class should be present everywhere, you could use the convenience function in any hook, special page, or anything else you wanted. Just be aware of potential performance or caching issues you may introduce with those changes.

高度な使用法
Want to see something really cool?

Auto-enroll groups
この例では、「自動登録」の設定を登録します. 利用者がこれをチェックし、特定のグループに属する新しい機能が出されると、利用者は自動的にその機能に登録されます.

Dependency management
Next up, we can actually define dependency management per-feature. To do this we first register the name of a hook that we want to use for this with the hook "GetBetaFeatureDependencyHooks", then we register a hook of that type that checks some dependency, and returns true if it's met or false if not.

You can abuse use this feature to do per-wiki disabling of features, if they're marked as dependent. But that sounds really hacky. You probably shouldn't. I can hear you thinking about it right now, just stop it.

Database stuff
There's a database table defined, and used, by BetaFeatures. But you might get confused by it if you try to use it locally.

We use the job queue to run updates for this table, when the cache expires (30 minutes TTL). If your wiki is configured to run jobs on each request, this will make about one request every 30 minutes reeeeeeally slow, but the rest will be relatively fast. If you configure your wiki to run jobs via cron, things will work much better.

関連項目

 * ベータ版機能
 * ロードマップ
 * 展開計画