MediaWiki REL1_32
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)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
$params