Extension:ApiFeatureUsage/zh

This page is a translated version of the page Extension:ApiFeatureUsage and the translation is 86% complete.
Other languages:
English • ‎Türkçe • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
ApiFeatureUsage
发布状态: 稳定版
实现 特殊页面 , API
描述 Access API功能使用日志摘要
作者 Brad Jorsch (Anomietalk)
最新版本 1.0 (2016-12-07)
兼容性方针 发行分支
MediaWiki 1.25+
PHP 5.5.9+
数据庫更新
许可协议 GNU通用公眾授權條款2.0或更新版本
下载
  • $wgApiFeatureUsageQueryEngineConf
翻译ApiFeatureUsage扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The ApiFeatureUsage extension adds a special page and an API module to fetch summaries of data logged by ApiBase::logFeatureUsage(), which is typically an indication of use of deprecated API features.

依赖性

Log data must be added to some sort of storage system. Currently Elasticsearch is supported via Extension:Elastica.

安装

  • 下载文件,并将其放置在您extensions/文件夹中的ApiFeatureUsage目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'ApiFeatureUsage' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

配置

Parameters
  • $wgApiFeatureUsageQueryEngineConf: Configuration array for accessing the log storage backend.
    class
    Backend access class to instantiate. Either this or factory is required.
    factory
    PHP callable which must return an instance of a backend access class. Either this or class is required.
Elastica backend (ApiFeatureUsageQueryEngineElastica)

Additional configuration values in $wgApiFeatureUsageQueryEngineConf:

serverList
Array of Elasticsearch servers. Required.
maxConnectionAttempts
Maximum connection attempts, default 1.
indexPrefix
Prefix for the indexes to use. Default "apifeatureusage-".
indexFormat
Date formatting for the indexes to use, see the PHP manual. Default "Y.m.d".
type
Elasticsearch type to query. Default "api-feature-usage-sanitized".
featureField
Field name for the logged value of $feature. Default "feature".
timestampField
Field name for the logged timestamp. Default "@timestamp".
agentField
Field name for the logged user agent. Default "agent".

用法

The extension adds a new special page, Special:ApiFeatureUsage, with a simple form to request a summary of feature usage logs for a user agent and date range.

The extension also adds an API query submodule, meta=featureusage. See the auto-generated API documentation for details.

参见