MediaWiki REL1_35
|
Send information about this MediaWiki instance to MediaWiki.org. More...
Public Member Functions | |
__construct (Config $config=null, LoggerInterface $logger=null) | |
getSystemInfo () | |
Collect basic data about this MediaWiki installation and return it as an associative array conforming to the Pingback schema on MetaWiki (https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback). | |
sendPingback () | |
Send information about this MediaWiki instance to MediaWiki.org. | |
Static Public Member Functions | |
static | schedulePingback () |
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send it. | |
Protected Attributes | |
Config | $config |
string | $id |
Randomly-generated identifier for this wiki. | |
string | $key |
updatelog key (also used as cache/db lock key) | |
LoggerInterface | $logger |
Private Member Functions | |
acquireLock () | |
Acquire lock for sending a pingback. | |
checkIfSent () | |
Has a pingback been sent in the last month for this MediaWiki version? | |
getData () | |
Get the EventLogging packet to be sent to the server. | |
getOrCreatePingbackId () | |
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 to its event beacon endpoint. | |
shouldSend () | |
Should a pingback be sent? | |
Send information about this MediaWiki instance to MediaWiki.org.
Definition at line 32 of file Pingback.php.
Pingback::__construct | ( | Config | $config = null , |
LoggerInterface | $logger = null |
||
) |
Config | null | $config | |
LoggerInterface | null | $logger |
Definition at line 57 of file Pingback.php.
References $config, $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 118 of file Pingback.php.
References $cache, DB_MASTER, and wfGetDB().
Referenced by sendPingback().
|
private |
Has a pingback been sent in the last month for this MediaWiki version?
Definition at line 75 of file Pingback.php.
References $dbr, DB_REPLICA, and wfGetDB().
Referenced by shouldSend().
|
private |
Get the EventLogging packet to be sent to the server.
Definition at line 171 of file Pingback.php.
References getOrCreatePingbackId(), and getSystemInfo().
Referenced by sendPingback().
|
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.
Definition at line 188 of file Pingback.php.
References $id, DB_MASTER, DB_REPLICA, MWCryptRand\generateHex(), and wfGetDB().
Referenced by getData().
Pingback::getSystemInfo | ( | ) |
Collect basic data about this MediaWiki installation and return it as an associative array conforming to the Pingback schema on MetaWiki (https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback).
This is public so we can display it in the installer
Developers: If you're adding a new piece of data to this, please ensure that you update https://www.mediawiki.org/wiki/Manual:$wgPingback
Definition at line 144 of file Pingback.php.
References MW_VERSION.
Referenced by getData().
|
private |
Record the fact that we have sent a pingback for this MediaWiki version, to ensure we don't submit data multiple times.
Definition at line 98 of file Pingback.php.
References DB_MASTER, and wfGetDB().
Referenced by sendPingback().
|
private |
Serialize pingback data and send it to MediaWiki.org via a POST to its event beacon endpoint.
The data encoding conforms to the expectations of EventLogging, a software suite used by the Wikimedia Foundation for logging and processing analytic data.
Compare: <https://github.com/wikimedia/mediawiki-extensions-EventLogging/ blob/7e5fe4f1ef/includes/EventLogging.php#L32-L74>
array | $data | Pingback data as an associative array |
Definition at line 230 of file Pingback.php.
Referenced by sendPingback().
|
static |
Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send it.
Definition at line 273 of file Pingback.php.
Pingback::sendPingback | ( | ) |
Send information about this MediaWiki instance to MediaWiki.org.
The data is structured and serialized to match the expectations of EventLogging, a software suite used by the Wikimedia Foundation for logging and processing analytic data.
Compare: <https://github.com/wikimedia/mediawiki-extensions-EventLogging/ blob/7e5fe4f1ef/includes/EventLogging.php#L32-L74>
The schema for the data is located at: https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback
Definition at line 252 of file Pingback.php.
References acquireLock(), getData(), markSent(), and postPingback().
|
private |
Should a pingback be sent?
Definition at line 67 of file Pingback.php.
References checkIfSent().
|
protected |
Definition at line 45 of file Pingback.php.
Referenced by __construct().
|
protected |
Randomly-generated identifier for this wiki.
Definition at line 51 of file Pingback.php.
Referenced by getOrCreatePingbackId().
|
protected |
updatelog key (also used as cache/db lock key)
Definition at line 48 of file Pingback.php.
|
protected |
Definition at line 42 of file Pingback.php.
Referenced by __construct().