/** * WebSocketManager constructor. * * @param Configuration $configuration * @param LoggerInterface $logger * @param EventDispatcher $eventDispatcher */ public function __construct(Configuration $configuration, LoggerInterface $logger, EventDispatcher $eventDispatcher) { parent::__construct($configuration, $logger, $eventDispatcher); // Keep track of clients $this->_connectedClients = new \SplObjectStorage(); $this->_authenticatedClients = new \SplObjectStorage(); }
/** * InstanceStateManager constructor. * * @param Configuration $configuration * @param LoggerInterface $logger * @param EventDispatcher $eventDispatcher */ public function __construct(Configuration $configuration, LoggerInterface $logger, EventDispatcher $eventDispatcher) { parent::__construct($configuration, $logger, $eventDispatcher); $this->_instances = new \SplObjectStorage(); // Attach a state to each instance foreach ($configuration->getInstances() as $instance) { $this->_instances->attach($instance, new InstanceState()); } }
/** * @inheritdoc */ public function __construct(Configuration $configuration, LoggerInterface $logger, EventDispatcher $eventDispatcher, LoopInterface $loop) { parent::__construct($configuration, $logger, $eventDispatcher); $socket = new SocketServer($loop); $socket->listen($configuration->getHttpListenPort(), $configuration->getListenAddress()); // Configure the web server $webroot = realpath(__DIR__ . '/../../client/app'); $this->_staticWebServer = new StaticWebServer(new HttpServer($socket), $webroot, $logger); // Configure the authentication handler $this->_staticWebServer->setAuthenticationHandler(new BasicAuthenticationHandler('tvheadend-status-manager', [$this, 'validateCredentials'])); }
/** * @inheritdoc */ public function __construct(Configuration $configuration, LoggerInterface $logger, EventDispatcher $eventDispatcher) { parent::__construct($configuration, $logger, $eventDispatcher); $this->_inputErrorCollection = new \SplObjectStorage(); }