]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
Add a real configuration for CS-Fixer
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Controller / WallabagV1Controller.php
1 <?php
2
3 namespace Wallabag\ImportBundle\Controller;
4
5 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6 use Symfony\Component\HttpFoundation\Request;
7
8 class WallabagV1Controller extends WallabagController
9 {
10 /**
11 * @Route("/wallabag-v1", name="import_wallabag_v1")
12 */
13 public function indexAction(Request $request)
14 {
15 return parent::indexAction($request);
16 }
17
18 /**
19 * {@inheritdoc}
20 */
21 protected function getImportService()
22 {
23 $service = $this->get('wallabag_import.wallabag_v1.import');
24
25 if ($this->get('craue_config')->get('import_with_rabbitmq')) {
26 $service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
27 } elseif ($this->get('craue_config')->get('import_with_redis')) {
28 $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
29 }
30
31 return $service;
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 protected function getImportTemplate()
38 {
39 return 'WallabagImportBundle:WallabagV1:index.html.twig';
40 }
41 }