module = new ActivityPubModule( $config ); } /** * Handles an incoming ActivityPub request * * @param Request $request (optional) The Symfony request object. * If not passed in, it is generated from the request globals. * * @return Response The response. Can be sent to the client with $response->send(). */ public function handle($request = null) { if ( !$request ) { $request = Request::createFromGlobals(); } $dispatcher = $this->module->get( EventDispatcher::class ); $dispatcher->addSubscriber( $this->module->get( Router::class ) ); $dispatcher->addSubscriber( $this->module->get( AuthListener::class ) ); $dispatcher->addSubscriber( $this->module->get( SignatureListener::class ) ); $dispatcher->addSubscriber( new ExceptionListener() ); $this->subscribeActivityHandlers( $dispatcher ); $controllerResolver = new ControllerResolver(); $argumentResolver = new ArgumentResolver(); $kernel = new HttpKernel( $dispatcher, $controllerResolver, new RequestStack(), $argumentResolver ); return $kernel->handle( $request ); } /** * Sets up the activity handling pipeline * * @param EventDispatcher $dispatcher The dispatcher to attach the event * subscribers to */ private function subscribeActivityHandlers(EventDispatcher $dispatcher) { $dispatcher->addSubscriber( $this->module->get( NonActivityHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( ValidationHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( CreateHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( UpdateHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( DeleteHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( FollowHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( AcceptHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( AddHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( RemoveHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( LikeHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( AnnounceHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( UndoHandler::class ) ); $dispatcher->addSubscriber( $this->module->get( ActivityPersister::class ) ); $dispatcher->addSubscriber( $this->module->get( DeliveryHandler::class ) ); } /** * Creates the database tables necessary for the library to function, * if they have not already been created. * * For best performance, this should only get called once in an application * (for example, when other database migrations get run). */ public function updateSchema() { $entityManager = @$this->module->get( EntityManager::class ); $driverName = $entityManager->getConnection()->getDriver()->getName(); if ( $driverName === 'pdo_mysql' ) { $entityManager->getConnection()->getDatabasePlatform() ->registerDoctrineTypeMapping('enum', 'string'); } $schemaTool = new SchemaTool( $entityManager ); $classes = $entityManager->getMetadataFactory()->getAllMetadata(); $schemaTool->updateSchema( $classes, true ); } }__halt_compiler();----SIGNATURE:----IF5yTG/orvX9oluVW7/KZ0PYQU353u67wGiNuNA+qdnOlsKuE4p9/Id2GRqOUQZtX27DkNx4ZvXe3UbzvofxE8kpRNIyA7cWiLlahnmgm5UH7j1yr0WoxFHkXamxm8oNEQLT+B9vXFww/maJZmsyagL5YnnfK8uQukp/SWaJ6UcQvXhaeri06FLzkjXF+AkoZtolWxdZB+da+IcHmVgBWe+luVxWaRznZ8sEBEVuO+M/r1z5Sg20Rv8YCjWVt4/05LlXPLmT2MiEvaHcPPqWTpk/HXqtbmWTmV+6Xh1rrc+EbEA+b65or4iY1naAUipGAy8PufQmp3M+aYX+FEv/Dxe3VU7NfAuFQmLp6h2q6XXt17txTtMoJ8+nnvwpyFyd7OTZ3CmclztcfDRbj3H+c03rvBqJNtzBPgn9aNxMQKZAS39YhNkwPwer2Q6Nj7FIUkLr3RUuCBMDQmWjYGTRNjA2T/ZqSvfHILTasKaYhWf9EZNWUGbNaaS1sh4ry6PSlk811iDLp89y8wSvpJFYuJfYb/8PZ+9/cy5FiOGXGwWUQN5Q8Rc3QT5RRTwD7KLeLh+NJwfR1JrnvcNWu/t30GuV25ISrmNUvD71BJgUXh5CZQUeuyvUseYZ1VIZ7DHEJgfZcTQpTN3bP7+bVUBPAhEj6F7GWdg0e7kawbR+U/c=----ATTACHMENT:----NDE5NjQ0NDY0MzYxNDY5IDgyMTYyNzE4ODA3MjQwODcgOTk2MDc1MzE4OTg2NTI4MQ==