1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00
wallabag/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2015-12-30 13:26:30 +01:00
<?php
namespace Wallabag\ImportBundle\Controller;
2022-08-28 02:01:46 +02:00
use Craue\ConfigBundle\Util\Config;
2015-12-30 13:26:30 +01:00
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\WallabagV1Import;
2015-12-30 13:26:30 +01:00
class WallabagV1Controller extends WallabagController
2015-12-30 13:26:30 +01:00
{
2017-07-01 09:52:38 +02:00
/**
* @Route("/wallabag-v1", name="import_wallabag_v1")
*/
public function indexAction(Request $request)
{
return parent::indexAction($request);
}
2015-12-30 13:26:30 +01:00
/**
* {@inheritdoc}
2015-12-30 13:26:30 +01:00
*/
protected function getImportService()
2015-12-30 13:26:30 +01:00
{
$service = $this->get(WallabagV1Import::class);
2016-09-04 21:49:21 +02:00
2022-08-28 02:01:46 +02:00
if ($this->get(Config::class)->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
2022-08-28 02:01:46 +02:00
} elseif ($this->get(Config::class)->get('import_with_redis')) {
$service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
2016-09-04 21:49:21 +02:00
}
return $service;
}
2015-12-30 13:26:30 +01:00
/**
* {@inheritdoc}
*/
protected function getImportTemplate()
{
return '@WallabagImport/WallabagV1/index.html.twig';
}
2015-12-30 13:26:30 +01:00
}