MediaWiki master
MediaWiki\Installer\Pingback Class Reference

Send information about this MediaWiki instance to mediawiki.org. More...

Collaboration diagram for MediaWiki\Installer\Pingback:

Public Member Functions

 __construct (Config $config, IConnectionProvider $dbProvider, BagOStuff $cache, HttpRequestFactory $http, LoggerInterface $logger, string $eventIntakeUrl=self::EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI)
 
 run ()
 Maybe send a ping.
 

Static Public Member Functions

static getSystemInfo (Config $config)
 Collect basic data about this MediaWiki installation and return it as an associative array conforming to the MediaWikiPingback event schema at https://gerrit.wikimedia.org/r/plugins/gitiles/schemas/event/secondary/+/refs/heads/master/jsonschema/analytics/legacy/mediawikipingback/.
 

Protected Member Functions

 getData ()
 Get the event to be sent to the server.
 

Protected Attributes

BagOStuff $cache
 
Config $config
 
IConnectionProvider $dbProvider
 
string $eventIntakeUri
 
HttpRequestFactory $http
 
string $key
 updatelog key (also used as cache/db lock key)
 
LoggerInterface $logger
 

Detailed Description

Send information about this MediaWiki instance to mediawiki.org.

This service uses two kinds of rows in the update_log database table:

  • ul_key PingBack, this holds a random identifier for this wiki, created only once, when the first ping after wiki creation is sent.
  • ul_key Pingback-<MW_VERSION>, this holds a timestamp and is created once after each MediaWiki upgrade, and then updated up to once a month.
Access: internal
For use by Setup.php only
Since
1.28

Definition at line 47 of file Pingback.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Installer\Pingback::__construct ( Config $config,
IConnectionProvider $dbProvider,
BagOStuff $cache,
HttpRequestFactory $http,
LoggerInterface $logger,
string $eventIntakeUrl = self::EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI )
Parameters
Config$config
IConnectionProvider$dbProvider
BagOStuff$cache
HttpRequestFactory$http
LoggerInterface$logger

Definition at line 100 of file Pingback.php.

References MediaWiki\Installer\Pingback\$cache, MediaWiki\Installer\Pingback\$config, MediaWiki\Installer\Pingback\$dbProvider, MediaWiki\Installer\Pingback\$http, MediaWiki\Installer\Pingback\$logger, and MW_VERSION.

Member Function Documentation

◆ getData()

MediaWiki\Installer\Pingback::getData ( )
protected

Get the event to be sent to the server.

Note well that, as well as the pingback data, only those fields required by the Event Platform are set (see https://wikitech.wikimedia.org/wiki/Event_Platform/Schemas/Guidelines#Required_fields).

Exceptions
DBErrorIf identifier insert fails
Returns
array

Definition at line 211 of file Pingback.php.

◆ getSystemInfo()

static MediaWiki\Installer\Pingback::getSystemInfo ( Config $config)
static

Collect basic data about this MediaWiki installation and return it as an associative array conforming to the MediaWikiPingback event schema at https://gerrit.wikimedia.org/r/plugins/gitiles/schemas/event/secondary/+/refs/heads/master/jsonschema/analytics/legacy/mediawikipingback/.

Developers: If you're adding a new piece of data to this, please document this data at https://www.mediawiki.org/wiki/Manual:$wgPingback.

Access: internal
For use by Installer only to display which data we send.
Parameters
Config$configWith DBtype set.
Returns
array

Definition at line 246 of file Pingback.php.

Referenced by MediaWiki\Installer\WebInstallerName\execute().

◆ run()

MediaWiki\Installer\Pingback::run ( )

Maybe send a ping.

Exceptions
DBErrorIf identifier insert fails
DBErrorIf timestamp upsert fails

Definition at line 123 of file Pingback.php.

Member Data Documentation

◆ $cache

BagOStuff MediaWiki\Installer\Pingback::$cache
protected

Definition at line 85 of file Pingback.php.

Referenced by MediaWiki\Installer\Pingback\__construct().

◆ $config

Config MediaWiki\Installer\Pingback::$config
protected

Definition at line 81 of file Pingback.php.

Referenced by MediaWiki\Installer\Pingback\__construct().

◆ $dbProvider

IConnectionProvider MediaWiki\Installer\Pingback::$dbProvider
protected

Definition at line 83 of file Pingback.php.

Referenced by MediaWiki\Installer\Pingback\__construct().

◆ $eventIntakeUri

string MediaWiki\Installer\Pingback::$eventIntakeUri
protected

Definition at line 91 of file Pingback.php.

◆ $http

HttpRequestFactory MediaWiki\Installer\Pingback::$http
protected

Definition at line 87 of file Pingback.php.

Referenced by MediaWiki\Installer\Pingback\__construct().

◆ $key

string MediaWiki\Installer\Pingback::$key
protected

updatelog key (also used as cache/db lock key)

Definition at line 89 of file Pingback.php.

◆ $logger

LoggerInterface MediaWiki\Installer\Pingback::$logger
protected
Initial value:
=
private const EVENT_PLATFORM_EVENT_INTAKE_SERVICE_URI
'https://intake-analytics.wikimedia.org/v1/events?hasty=true'

Definition at line 79 of file Pingback.php.

Referenced by MediaWiki\Installer\Pingback\__construct().


The documentation for this class was generated from the following file: