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