Extension:ApiFeatureUsage

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:ApiFeatureUsage and the translation is 17% complete.
Manuel des extensions MediaWiki
OOjs UI icon advanced-invert.svg
ApiFeatureUsage
État de la version : stable
Implémentation Page spéciale , API
Description Access API feature usage log summaries
Auteur(s) Brad Jorsch (Anomiediscussion)
Dernière version 1.0 (2016-12-07)
Politique de compatibilité Versions ponctuelles alignées avec MediaWiki. Le master n'est pas compatible arrière.
MediaWiki 1.25+
PHP 5.5.9+
Modifie la base
de données
Non
Licence Licence publique générale GNU v2.0 ou supérieur
Téléchargement
  • $wgApiFeatureUsageQueryEngineConf
Traduire l’extension ApiFeatureUsage

Vérifier la matrice des utilisations et des versions.

Problèmes Tâches ouvertes · Signaler un bogue

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.

Dépendances

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

Installation

  • Téléchargez et placez le(s) fichiers (s) dans un répertoire appelé ApiFeatureUsage dans votre dossier extensions/.
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php :
    wfLoadExtension( 'ApiFeatureUsage' );
    
  • Yes Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.

Configuration

Parameters
  • $wgApiFeatureUsageQueryEngineConfConfiguration 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".

Utilisation

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.

Voir aussi