forked from wallabag/wallabag
Merge branch '2.6' into master
This commit is contained in:
@ -58,6 +58,7 @@ class ImportController extends AbstractController
|
||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('elcurator')
|
||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('shaarli')
|
||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pocket_html')
|
||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pocket_csv')
|
||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('omnivore')
|
||||
;
|
||||
} catch (\Exception) {
|
||||
@ -77,6 +78,7 @@ class ImportController extends AbstractController
|
||||
+ $this->redisClient->llen('wallabag.import.elcurator')
|
||||
+ $this->redisClient->llen('wallabag.import.shaarli')
|
||||
+ $this->redisClient->llen('wallabag.import.pocket_html')
|
||||
+ $this->redisClient->llen('wallabag.import.pocket_csv')
|
||||
+ $this->redisClient->llen('wallabag.import.omnivore')
|
||||
;
|
||||
} catch (\Exception) {
|
||||
|
||||
46
src/Controller/Import/PocketCsvController.php
Normal file
46
src/Controller/Import/PocketCsvController.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\Controller\Import;
|
||||
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\Import\PocketCsvImport;
|
||||
use Wallabag\Redis\Producer as RedisProducer;
|
||||
|
||||
class PocketCsvController extends HtmlController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly PocketCsvImport $pocketCsvImport,
|
||||
private readonly Config $craueConfig,
|
||||
private readonly RabbitMqProducer $rabbitMqProducer,
|
||||
private readonly RedisProducer $redisProducer,
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route(path: '/import/pocket_csv', name: 'import_pocket_csv', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
}
|
||||
|
||||
protected function getImportService()
|
||||
{
|
||||
if ($this->craueConfig->get('import_with_rabbitmq')) {
|
||||
$this->pocketCsvImport->setProducer($this->rabbitMqProducer);
|
||||
} elseif ($this->craueConfig->get('import_with_redis')) {
|
||||
$this->pocketCsvImport->setProducer($this->redisProducer);
|
||||
}
|
||||
|
||||
return $this->pocketCsvImport;
|
||||
}
|
||||
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return 'Import/PocketCsv/index.html.twig';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user