MediaWiki
1.28.0
|
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). More... | |
sendPingback () | |
Send information about this MediaWiki instance to MediaWiki.org. More... | |
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. More... | |
Protected Attributes | |
Config | $config |
string | $id |
Randomly-generated identifier for this wiki. More... | |
string | $key |
updatelog key (also used as cache/db lock key) More... | |
LoggerInterface | $logger |
Private Member Functions | |
acquireLock () | |
Acquire lock for sending a pingback. More... | |
checkIfSent () | |
Has a pingback already been sent for this MediaWiki version? More... | |
getData () | |
Get the EventLogging packet to be sent to the server. More... | |
getOrCreatePingbackId () | |
Get a unique, stable identifier for this wiki. More... | |
markSent () | |
Record the fact that we have sent a pingback for this MediaWiki version, to ensure we don't submit data multiple times. More... | |
postPingback (array $data) | |
Serialize pingback data and send it to MediaWiki.org via a POST to its event beacon endpoint. More... | |
shouldSend () | |
Should a pingback be sent? More... | |
Send information about this MediaWiki instance to MediaWiki.org.
Definition at line 31 of file Pingback.php.
Pingback::__construct | ( | Config | $config = null , |
LoggerInterface | $logger = null |
||
) |
Config | $config | |
LoggerInterface | $logger |
Definition at line 56 of file Pingback.php.
References RequestContext\getMain(), and key.
|
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 99 of file Pingback.php.
References $cache, DB_MASTER, ObjectCache\getLocalClusterInstance(), and wfGetDB().
Referenced by sendPingback().
|
private |
Has a pingback already been sent for this MediaWiki version?
Definition at line 74 of file Pingback.php.
References $dbr, DB_REPLICA, key, and wfGetDB().
Referenced by shouldSend().
|
private |
Get the EventLogging packet to be sent to the server.
Definition at line 152 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 169 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 125 of file Pingback.php.
References $limit.
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 85 of file Pingback.php.
References DB_MASTER, key, 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 211 of file Pingback.php.
References FormatJson\encode(), and Http\post().
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 253 of file Pingback.php.
References DeferredUpdates\addCallableUpdate(), and sendPingback().
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 232 of file Pingback.php.
References acquireLock(), getData(), markSent(), and postPingback().
Referenced by schedulePingback().
|
private |
Should a pingback be sent?
Definition at line 66 of file Pingback.php.
References checkIfSent().
|
protected |
Definition at line 44 of file Pingback.php.
|
protected |
Randomly-generated identifier for this wiki.
Definition at line 50 of file Pingback.php.
Referenced by getOrCreatePingbackId().
|
protected |
updatelog key (also used as cache/db lock key)
Definition at line 47 of file Pingback.php.
|
protected |
Definition at line 33 of file Pingback.php.