MediaWiki REL1_31
EventRelayer.php
Go to the documentation of this file.
1<?php
20use Psr\Log\LoggerInterface;
21use Psr\Log\LoggerAwareInterface;
22use Psr\Log\NullLogger;
23
27abstract class EventRelayer implements LoggerAwareInterface {
29 protected $logger;
30
34 public function __construct( array $params ) {
35 $this->logger = new NullLogger();
36 }
37
43 final public function notify( $channel, $event ) {
44 return $this->doNotify( $channel, [ $event ] );
45 }
46
52 final public function notifyMulti( $channel, $events ) {
53 return $this->doNotify( $channel, $events );
54 }
55
56 public function setLogger( LoggerInterface $logger ) {
57 $this->logger = $logger;
58 }
59
65 abstract protected function doNotify( $channel, array $events );
66}
Base class for reliable event relays.
setLogger(LoggerInterface $logger)
LoggerInterface $logger
notify( $channel, $event)
notifyMulti( $channel, $events)
doNotify( $channel, array $events)
__construct(array $params)
$params