. /** * Main GNU social entry point * * @package GNUsocial * @category Framework * * @author Brenda Wallace * @author Brion Vibber * @author Brion Vibber * @author Christopher Vollick * @author CiaranG * @author Craig Andrews * @author Craig Andrews * @author Evan Prodromou * @author Evan Prodromou * @author Evan Prodromou * @author Evan Prodromou * @author Gina Haeussge * @author James Walker * @author Jeffery To * @author Jeffery To * @author Mikael Nordfeldth * @author Mike Cochrane * @author Robin Millette * @author Sarven Capadisli * @author Sarven Capadisli * @author Siebrand Mazeland * @author Tom Adams * @author Tom Adams * @author Zach Copley * @author Diogo Cordeiro * @author Hugo Sales * @copyright 2010, 2018-2020 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace App\Util; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Contracts\Translation\TranslatorInterface; class GNUsocial implements EventSubscriberInterface { protected ContainerInterface $container; protected LoggerInterface $logger; protected TranslatorInterface $translator; public function __construct(ContainerInterface $container, LoggerInterface $logger, TranslatorInterface $translator) { $this->container = $container; $this->logger = $logger; $this->translator = $translator; } public function onKernelRequest(RequestEvent $event, string $event_name, $event_dispatcher): RequestEvent { Log::setLogger($this->logger); GSEvent::setDispatcher($event_dispatcher); I18n::setTranslator($this->translator); ExtensionManager::loadExtensions(); return $event; } public static function getSubscribedEvents() { return [KernelEvents::REQUEST => 'onKernelRequest']; } }