X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FController%2FWallabagV2Controller.php;h=ab26400cfb1e445b2a5310a72df85139f5a44a0e;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=c2a42165b643b84cbf2c3f79ef1af46de3e289be;hpb=b787a7757ea73b9d10c14cb21758feb07dfc5885;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php index c2a42165..ab26400c 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php @@ -8,26 +8,34 @@ use Symfony\Component\HttpFoundation\Request; class WallabagV2Controller extends WallabagController { /** - * {@inheritdoc} + * @Route("/wallabag-v2", name="import_wallabag_v2") */ - protected function getImportService() + public function indexAction(Request $request) { - return $this->get('wallabag_import.wallabag_v2.import'); + return parent::indexAction($request); } /** * {@inheritdoc} */ - protected function getImportTemplate() + protected function getImportService() { - return 'WallabagImportBundle:WallabagV2:index.html.twig'; + $service = $this->get('wallabag_import.wallabag_v2.import'); + + if ($this->get('craue_config')->get('import_with_rabbitmq')) { + $service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v2_producer')); + } elseif ($this->get('craue_config')->get('import_with_redis')) { + $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v2')); + } + + return $service; } /** - * @Route("/wallabag-v2", name="import_wallabag_v2") + * {@inheritdoc} */ - public function indexAction(Request $request) + protected function getImportTemplate() { - return parent::indexAction($request); + return 'WallabagImportBundle:WallabagV2:index.html.twig'; } }