]>
Commit | Line | Data |
---|---|---|
6785f4aa NL |
1 | <?php |
2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | |
4 | ||
6785f4aa NL |
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
6 | use Symfony\Component\HttpFoundation\Request; | |
6785f4aa | 7 | |
b787a775 | 8 | class WallabagV2Controller extends WallabagController |
6785f4aa | 9 | { |
f808b016 JB |
10 | /** |
11 | * @Route("/wallabag-v2", name="import_wallabag_v2") | |
12 | */ | |
13 | public function indexAction(Request $request) | |
14 | { | |
15 | return parent::indexAction($request); | |
16 | } | |
17 | ||
6785f4aa | 18 | /** |
b787a775 | 19 | * {@inheritdoc} |
6785f4aa | 20 | */ |
b787a775 | 21 | protected function getImportService() |
6785f4aa | 22 | { |
c98db1b6 JB |
23 | $service = $this->get('wallabag_import.wallabag_v2.import'); |
24 | ||
b3437d58 JB |
25 | if ($this->get('craue_config')->get('import_with_rabbitmq')) { |
26 | $service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v2_producer')); | |
27 | } elseif ($this->get('craue_config')->get('import_with_redis')) { | |
28 | $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v2')); | |
c98db1b6 JB |
29 | } |
30 | ||
31 | return $service; | |
b787a775 | 32 | } |
6785f4aa | 33 | |
b787a775 JB |
34 | /** |
35 | * {@inheritdoc} | |
36 | */ | |
37 | protected function getImportTemplate() | |
38 | { | |
39 | return 'WallabagImportBundle:WallabagV2:index.html.twig'; | |
40 | } | |
6785f4aa | 41 | } |