MediaWiki REL1_37
|
Send information about this MediaWiki instance to mediawiki.org. More...
Public Member Functions | |
__construct (Config $config, ILoadBalancer $lb, BagOStuff $cache, HttpRequestFactory $http, LoggerInterface $logger) | |
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 Pingback schema on Meta-Wiki (https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback). | |
static | schedulePingback () |
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send it. | |
Protected Member Functions | |
getData () | |
Get the EventLogging packet to be sent to the server. | |
Protected Attributes | |
BagOStuff | $cache |
Config | $config |
HttpRequestFactory | $http |
string | $key |
updatelog key (also used as cache/db lock key) | |
ILoadBalancer | $lb |
LoggerInterface | $logger |
Private Member Functions | |
acquireLock () | |
Acquire lock for sending a pingback. | |
fetchOrInsertId () | |
Get a unique, stable identifier for this wiki. | |
markSent () | |
Record the fact that we have sent a pingback for this MediaWiki version, to ensure we don't submit data multiple times. | |
postPingback (array $data) | |
Serialize pingback data and send it to mediawiki.org via a POST request to its EventLogging beacon endpoint. | |
wasRecentlySent () | |
Was a pingback sent in the last month for this MediaWiki version? | |
Send information about this MediaWiki instance to mediawiki.org.
This service uses two kinds of rows in the update_log
database table:
PingBack
, this holds a random identifier for this wiki, created only once, when the first ping after wiki creation is sent.Pingback-<MW_VERSION>
, this holds a timestamp and is created once after each MediaWiki upgrade, and then updated up to once a month.Definition at line 44 of file Pingback.php.
Pingback::__construct | ( | Config | $config, |
ILoadBalancer | $lb, | ||
BagOStuff | $cache, | ||
HttpRequestFactory | $http, | ||
LoggerInterface | $logger | ||
) |
Config | $config | |
ILoadBalancer | $lb | |
BagOStuff | $cache | |
HttpRequestFactory | $http | |
LoggerInterface | $logger |
Definition at line 71 of file Pingback.php.
References $cache, $config, $http, $lb, $logger, and MW_VERSION.
|
private |
Acquire lock for sending a pingback.
This ensures only one thread can attempt to send a pingback at any given time and that we wait an hour before retrying failed attempts.
Definition at line 147 of file Pingback.php.
|
private |
Get a unique, stable identifier for this wiki.
If the identifier does not already exist, create it and save it in the database. The identifier is randomly-generated.
DBError | If identifier insert fails |
Definition at line 221 of file Pingback.php.
|
protected |
Get the EventLogging packet to be sent to the server.
DBError | If identifier insert fails |
Definition at line 169 of file Pingback.php.
|
static |
Collect basic data about this MediaWiki installation and return it as an associative array conforming to the Pingback schema on Meta-Wiki (https://meta.wikimedia.org/wiki/Schema: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.
Config | $config | With DBtype set. |
Definition at line 190 of file Pingback.php.
Referenced by WebInstallerName\execute().
|
private |
Record the fact that we have sent a pingback for this MediaWiki version, to ensure we don't submit data multiple times.
DBError | If timestamp upsert fails |
Definition at line 274 of file Pingback.php.
|
private |
Serialize pingback data and send it to mediawiki.org via a POST request to its EventLogging beacon endpoint.
The data encoding conforms to the expectations of EventLogging as used by Wikimedia Foundation for logging and processing analytic data.
The schema for the data is located at: https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback
array | $data | Pingback data as an associative array |
Definition at line 261 of file Pingback.php.
Pingback::run | ( | ) |
Maybe send a ping.
DBError | If identifier insert fails |
DBError | If timestamp upsert fails |
Definition at line 92 of file Pingback.php.
|
static |
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send it.
Definition at line 290 of file Pingback.php.
|
private |
Was a pingback sent in the last month for this MediaWiki version?
Definition at line 121 of file Pingback.php.
|
protected |
Definition at line 58 of file Pingback.php.
Referenced by __construct().
|
protected |
Definition at line 54 of file Pingback.php.
Referenced by __construct().
|
protected |
Definition at line 60 of file Pingback.php.
Referenced by __construct().
|
protected |
updatelog key (also used as cache/db lock key)
Definition at line 62 of file Pingback.php.
|
protected |
Definition at line 56 of file Pingback.php.
Referenced by __construct().
|
protected |
Definition at line 52 of file Pingback.php.
Referenced by __construct().