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