* @return bool
*/
private function checkIfSent() {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$sent = $dbr->selectField(
'updatelog', '1', [ 'ul_key' => $this->key ], __METHOD__ );
return $sent !== false;
* 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
+ *
* @return array
*/
- private function getData() {
+ public function getSystemInfo() {
$event = [
'database' => $this->config->get( 'DBtype' ),
'MediaWiki' => $this->config->get( 'Version' ),
$event['memoryLimit'] = $limit;
}
+ return $event;
+ }
+
+ /**
+ * Get the EventLogging packet to be sent to the server
+ *
+ * @return array
+ */
+ private function getData() {
return [
'schema' => 'MediaWikiPingback',
'revision' => self::SCHEMA_REV,
'wiki' => $this->getOrCreatePingbackId(),
- 'event' => $event,
+ 'event' => $this->getSystemInfo(),
];
}
*/
private function getOrCreatePingbackId() {
if ( !$this->id ) {
- $id = wfGetDB( DB_SLAVE )->selectField(
+ $id = wfGetDB( DB_REPLICA )->selectField(
'updatelog', 'ul_value', [ 'ul_key' => 'PingBack' ] );
if ( $id == false ) {
* <https://github.com/wikimedia/mediawiki-extensions-EventLogging/
* blob/7e5fe4f1ef/includes/EventLogging.php#L32-L74>
*
- * @param data Pingback data as an associative array
+ * @param array $data Pingback data as an associative array
* @return bool true on success, false on failure
*/
private function postPingback( array $data ) {
*
* The schema for the data is located at:
* <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>
+ * @return bool
*/
public function sendPingback() {
if ( !$this->acquireLock() ) {