public function addRealm(Realm $realm) { $realmName = $realm->getRealmName(); if (!static::validRealmName($realm->getRealmName())) { throw new InvalidRealmNameException(); } if (array_key_exists($realm->getRealmName(), $this->realms)) { throw new \Exception("There is already a realm \"" . $realm->getRealmName() . "\""); } $this->manager->debug("Adding realm \"" . $realmName . "\""); if ($realm->getManager() instanceof ManagerDummy) { /** remind people that we don't setup the manager for them if they * are creating their own realms */ $this->manager->warning("Realm \"" . $realmName . "\" is using ManagerDummy"); } $this->realms[$realm->getRealmName()] = $realm; }
/** * @param Session $session */ public function leave(Session $session) { $this->manager->debug("Leaving realm {$session->getRealm()->getRealmName()}"); if ($this->getAuthenticationManager() !== null) { $this->getAuthenticationManager()->onSessionClose($session); } foreach ($this->roles as $role) { $role->leave($session); } }
/** * @param Session $session */ public function leave(Session $session) { $this->registrations->rewind(); while ($this->registrations->valid()) { /* @var $registration Registration */ $registration = $this->registrations->current(); $this->registrations->next(); if ($registration->getSession() == $session) { $this->manager->debug("Leaving and unegistering: {$registration->getProcedureName()}"); $this->registrations->detach($registration); } } }
/** * //@todo make this better * @param Session $session */ public function leave(Session $session) { $this->subscriptions->rewind(); while ($this->subscriptions->valid()) { /* @var $subscription Subscription */ $subscription = $this->subscriptions->current(); $this->subscriptions->next(); if ($subscription->getSession() == $session) { $this->manager->debug("Leaving and unsubscribing: {$subscription->getTopic()}"); $this->subscriptions->detach($subscription); } } foreach ($this->topics as $topicName => $subscribers) { foreach ($subscribers as $key => $subscriber) { if ($session == $subscriber) { unset($subscribers[$key]); $this->manager->debug("Removing session from topic list: {$topicName}"); } } } }
/** * @param ManagerInterface $manager */ public function setManager(ManagerInterface $manager) { $this->manager = $manager; $this->manager->info("Manager attached to PawlTransportProvider"); }
/** * @param ManagerInterface $manager */ public function setManager($manager) { $this->manager = $manager; $this->manager->addCallable("manager.procedure." . $this->getProcedureName() . "get_registrations", $this->getRegistrations()); }