/** * @param Event $event */ public function onGetServiceConfig(Event $event) { if (true === $this->application->isStarted()) { $config = $event->getTarget(); if (null !== ($override_site = $config->getRawSection('override_site'))) { if (array_key_exists($this->application->getSite()->getUid(), $override_site)) { foreach ($override_site[$this->application->getSite()->getUid()] as $section => $data) { $config->setSection($section, $data, true); } } } $this->application->getContainer()->getDefinition($event->getArgument('id'))->clearTag('config_per_site'); } }
/** * Checks is a request is available. * * @return boolean Returns true is a request is available, false otherwise. */ private function hasRequestAvailable() { return null !== $this->application && !$this->application->isClientSAPI() && $this->application->isStarted(); }