扩展:ApiFeatureUsage
Jump to navigation
Jump to search
ApiFeatureUsage 发布状态: 稳定版 |
|
---|---|
实现 | 特殊页面 , API |
描述 | Access API功能使用日志摘要 |
作者 | Brad Jorsch (Anomie讨论) |
最新版本 | 1.0 (2016-12-07) |
兼容性方针 | Snapshots releases along with MediaWiki. Master is not backwards compatible. |
MediaWiki | 1.25+ |
PHP | 5.5.9+ |
数据庫更改 | 否 |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下载 | |
|
|
翻譯ApiFeatureUsage擴充功能 | |
问题 | 尚未完成的工作 · 回報錯誤 |
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 扩展: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.
参见
![]() | 此扩展被用于一个或多个维基媒体项目上。 这可能意味着扩展稳定且工作良好,足以用在同等高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中寻找此扩展名称以查看安装它的网站。 详细的已安装扩展的完整列表可在wiki的Special:Version页面找到。 |