Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\WikibasePingback Class Reference

Send information about this Wikibase instance to TODO. More...

Public Member Functions

 __construct (Config $config=null, LoggerInterface $logger=null, ExtensionRegistry $extensionRegistry=null, SettingsArray $wikibaseRepoSettings=null, HTTPRequestFactory $requestFactory=null, RepoDomainDb $repoDomainDb=null, string $key=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 ()
 

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...
 
static doSchedule (WikibasePingback $instance=null)
 

Public Attributes

const HEARTBEAT_TIMEOUT = 60 * 60 * 24 * 30
 

Protected Attributes

 $logger
 
 $config
 
 $key
 
 $id
 

Private Member Functions

 shouldSend ()
 Should a pingback be sent? More...
 
 checkIfSent ()
 Has a pingback been sent in the last month for this MediaWiki version? More...
 
 markSent ()
 Record the fact that we have sent a pingback for this Wikibase version, to ensure we don't submit data multiple times. More...
 
 acquireLock ()
 Acquire lock for sending a pingback. More...
 
 getTrackedExtensions ()
 
 getData ()
 Get the EventLogging packet to be sent to the server. More...
 
 getOrCreatePingbackId ()
 Get a unique, stable identifier for this wiki. More...
 
 postPingback (array $data)
 Serialize pingback data and send it to MediaWiki.org via a POST to its event beacon endpoint. More...
 

Private Attributes

const SCHEMA_REV = 20782637
 
const MINIMUM_NUMBER_OF_ENTITIES = 10
 
 $host
 
 $extensionRegistry
 
 $wikibaseRepoSettings
 
 $requestFactory
 
 $repoConnections
 

Detailed Description

Send information about this Wikibase instance to TODO.

See also
Pingback

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\WikibasePingback::__construct ( Config  $config = null,
LoggerInterface  $logger = null,
ExtensionRegistry  $extensionRegistry = null,
SettingsArray  $wikibaseRepoSettings = null,
HTTPRequestFactory  $requestFactory = null,
RepoDomainDb  $repoDomainDb = null,
string  $key = null 
)
Parameters
Config | null$config
LoggerInterface | null$logger
ExtensionRegistry | null$extensionRegistry
SettingsArray | null$wikibaseRepoSettings
HttpRequestFactory | null$requestFactory
RepoDomainDb | null$repoDomainDb
string | null$key

Member Function Documentation

◆ acquireLock()

Wikibase\Repo\WikibasePingback::acquireLock ( )
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.

Returns
bool Whether lock was acquired

◆ checkIfSent()

Wikibase\Repo\WikibasePingback::checkIfSent ( )
private

Has a pingback been sent in the last month for this MediaWiki version?

Returns
bool

◆ doSchedule()

static Wikibase\Repo\WikibasePingback::doSchedule ( WikibasePingback  $instance = null)
static

◆ getData()

Wikibase\Repo\WikibasePingback::getData ( )
private

Get the EventLogging packet to be sent to the server.

Returns
array

◆ getOrCreatePingbackId()

Wikibase\Repo\WikibasePingback::getOrCreatePingbackId ( )
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.

Returns
string 32-character hex string

◆ getSystemInfo()

Wikibase\Repo\WikibasePingback::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

Returns
array

◆ getTrackedExtensions()

Wikibase\Repo\WikibasePingback::getTrackedExtensions ( )
private

◆ markSent()

Wikibase\Repo\WikibasePingback::markSent ( )
private

Record the fact that we have sent a pingback for this Wikibase version, to ensure we don't submit data multiple times.

Returns
bool

◆ postPingback()

Wikibase\Repo\WikibasePingback::postPingback ( array  $data)
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>

Parameters
array$dataPingback data as an associative array
Returns
bool true on success, false on failure

◆ schedulePingback()

static Wikibase\Repo\WikibasePingback::schedulePingback ( )
static

Schedule a deferred callable that will check if a pingback should be sent and (if so) proceed to send it.

◆ sendPingback()

Wikibase\Repo\WikibasePingback::sendPingback ( )
Returns
bool

◆ shouldSend()

Wikibase\Repo\WikibasePingback::shouldSend ( )
private

Should a pingback be sent?

Returns
bool

Member Data Documentation

◆ $config

Wikibase\Repo\WikibasePingback::$config
protected

◆ $extensionRegistry

Wikibase\Repo\WikibasePingback::$extensionRegistry
private

◆ $host

Wikibase\Repo\WikibasePingback::$host
private

◆ $id

Wikibase\Repo\WikibasePingback::$id
protected

◆ $key

Wikibase\Repo\WikibasePingback::$key
protected

◆ $logger

Wikibase\Repo\WikibasePingback::$logger
protected

◆ $repoConnections

Wikibase\Repo\WikibasePingback::$repoConnections
private

◆ $requestFactory

Wikibase\Repo\WikibasePingback::$requestFactory
private

◆ $wikibaseRepoSettings

Wikibase\Repo\WikibasePingback::$wikibaseRepoSettings
private

◆ HEARTBEAT_TIMEOUT

const Wikibase\Repo\WikibasePingback::HEARTBEAT_TIMEOUT = 60 * 60 * 24 * 30

◆ MINIMUM_NUMBER_OF_ENTITIES

const Wikibase\Repo\WikibasePingback::MINIMUM_NUMBER_OF_ENTITIES = 10
private

◆ SCHEMA_REV

const Wikibase\Repo\WikibasePingback::SCHEMA_REV = 20782637
private

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