Move Import consumers to Core

This commit is contained in:
Yassine Guedidi 2023-12-31 10:03:14 +01:00
parent b6b067c969
commit ed4b20f27f
10 changed files with 35 additions and 35 deletions

View file

@ -34,7 +34,7 @@ services:
Wallabag\CoreBundle\: Wallabag\CoreBundle\:
resource: '../../src/Wallabag/CoreBundle/*' resource: '../../src/Wallabag/CoreBundle/*'
exclude: ['../../src/Wallabag/CoreBundle/{Controller,Entity,DataFixtures}', '../../src/Wallabag/CoreBundle/Event/*Event.php'] exclude: ['../../src/Wallabag/CoreBundle/{Consumer,Controller,Entity,DataFixtures}', '../../src/Wallabag/CoreBundle/Event/*Event.php']
# controllers are imported separately to make sure services can be injected # controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class # as action arguments even if you don't extend any base controller class

View file

@ -5,7 +5,7 @@ services:
autoconfigure: true autoconfigure: true
public: true public: true
Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy: Wallabag\CoreBundle\Consumer\RabbitMQConsumerTotalProxy:
arguments: arguments:
$pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer' $pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer'
$readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer' $readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer'
@ -21,61 +21,61 @@ services:
$pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer' $pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer'
wallabag_import.consumer.amqp.pocket: wallabag_import.consumer.amqp.pocket:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PocketImport' $import: '@Wallabag\ImportBundle\Import\PocketImport'
wallabag_import.consumer.amqp.readability: wallabag_import.consumer.amqp.readability:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ReadabilityImport' $import: '@Wallabag\ImportBundle\Import\ReadabilityImport'
wallabag_import.consumer.amqp.instapaper: wallabag_import.consumer.amqp.instapaper:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\InstapaperImport' $import: '@Wallabag\ImportBundle\Import\InstapaperImport'
wallabag_import.consumer.amqp.pinboard: wallabag_import.consumer.amqp.pinboard:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PinboardImport' $import: '@Wallabag\ImportBundle\Import\PinboardImport'
wallabag_import.consumer.amqp.delicious: wallabag_import.consumer.amqp.delicious:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\DeliciousImport' $import: '@Wallabag\ImportBundle\Import\DeliciousImport'
wallabag_import.consumer.amqp.wallabag_v1: wallabag_import.consumer.amqp.wallabag_v1:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\WallabagV1Import' $import: '@Wallabag\ImportBundle\Import\WallabagV1Import'
wallabag_import.consumer.amqp.wallabag_v2: wallabag_import.consumer.amqp.wallabag_v2:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\WallabagV2Import' $import: '@Wallabag\ImportBundle\Import\WallabagV2Import'
wallabag_import.consumer.amqp.elcurator: wallabag_import.consumer.amqp.elcurator:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ElcuratorImport' $import: '@Wallabag\ImportBundle\Import\ElcuratorImport'
wallabag_import.consumer.amqp.firefox: wallabag_import.consumer.amqp.firefox:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\FirefoxImport' $import: '@Wallabag\ImportBundle\Import\FirefoxImport'
wallabag_import.consumer.amqp.chrome: wallabag_import.consumer.amqp.chrome:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ChromeImport' $import: '@Wallabag\ImportBundle\Import\ChromeImport'
wallabag_import.consumer.amqp.shaarli: wallabag_import.consumer.amqp.shaarli:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ShaarliImport' $import: '@Wallabag\ImportBundle\Import\ShaarliImport'
wallabag_import.consumer.amqp.pocket_html: wallabag_import.consumer.amqp.pocket_html:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport' $import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'

View file

@ -17,7 +17,7 @@ services:
- "@wallabag_import.queue.redis.readability" - "@wallabag_import.queue.redis.readability"
wallabag_import.consumer.redis.readability: wallabag_import.consumer.redis.readability:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ReadabilityImport' $import: '@Wallabag\ImportBundle\Import\ReadabilityImport'
@ -33,7 +33,7 @@ services:
- "@wallabag_import.queue.redis.instapaper" - "@wallabag_import.queue.redis.instapaper"
wallabag_import.consumer.redis.instapaper: wallabag_import.consumer.redis.instapaper:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\InstapaperImport' $import: '@Wallabag\ImportBundle\Import\InstapaperImport'
@ -49,7 +49,7 @@ services:
- "@wallabag_import.queue.redis.pinboard" - "@wallabag_import.queue.redis.pinboard"
wallabag_import.consumer.redis.pinboard: wallabag_import.consumer.redis.pinboard:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PinboardImport' $import: '@Wallabag\ImportBundle\Import\PinboardImport'
@ -65,7 +65,7 @@ services:
- "@wallabag_import.queue.redis.delicious" - "@wallabag_import.queue.redis.delicious"
wallabag_import.consumer.redis.delicious: wallabag_import.consumer.redis.delicious:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\DeliciousImport' $import: '@Wallabag\ImportBundle\Import\DeliciousImport'
@ -81,7 +81,7 @@ services:
- "@wallabag_import.queue.redis.pocket" - "@wallabag_import.queue.redis.pocket"
wallabag_import.consumer.redis.pocket: wallabag_import.consumer.redis.pocket:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PocketImport' $import: '@Wallabag\ImportBundle\Import\PocketImport'
@ -97,7 +97,7 @@ services:
- "@wallabag_import.queue.redis.wallabag_v1" - "@wallabag_import.queue.redis.wallabag_v1"
wallabag_import.consumer.redis.wallabag_v1: wallabag_import.consumer.redis.wallabag_v1:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\WallabagV1Import' $import: '@Wallabag\ImportBundle\Import\WallabagV1Import'
@ -113,7 +113,7 @@ services:
- "@wallabag_import.queue.redis.wallabag_v2" - "@wallabag_import.queue.redis.wallabag_v2"
wallabag_import.consumer.redis.wallabag_v2: wallabag_import.consumer.redis.wallabag_v2:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\WallabagV2Import' $import: '@Wallabag\ImportBundle\Import\WallabagV2Import'
@ -129,7 +129,7 @@ services:
- "@wallabag_import.queue.redis.elcurator" - "@wallabag_import.queue.redis.elcurator"
wallabag_import.consumer.redis.elcurator: wallabag_import.consumer.redis.elcurator:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ElcuratorImport' $import: '@Wallabag\ImportBundle\Import\ElcuratorImport'
@ -145,7 +145,7 @@ services:
- "@wallabag_import.queue.redis.firefox" - "@wallabag_import.queue.redis.firefox"
wallabag_import.consumer.redis.firefox: wallabag_import.consumer.redis.firefox:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\FirefoxImport' $import: '@Wallabag\ImportBundle\Import\FirefoxImport'
@ -161,7 +161,7 @@ services:
- "@wallabag_import.queue.redis.chrome" - "@wallabag_import.queue.redis.chrome"
wallabag_import.consumer.redis.chrome: wallabag_import.consumer.redis.chrome:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ChromeImport' $import: '@Wallabag\ImportBundle\Import\ChromeImport'
@ -177,7 +177,7 @@ services:
- "@wallabag_import.queue.redis.shaarli" - "@wallabag_import.queue.redis.shaarli"
wallabag_import.consumer.redis.shaarli: wallabag_import.consumer.redis.shaarli:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\ShaarliImport' $import: '@Wallabag\ImportBundle\Import\ShaarliImport'
@ -193,6 +193,6 @@ services:
- "@wallabag_import.queue.redis.pocket_html" - "@wallabag_import.queue.redis.pocket_html"
wallabag_import.consumer.redis.pocket_html: wallabag_import.consumer.redis.pocket_html:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer
arguments: arguments:
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport' $import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Wallabag\ImportBundle\Consumer; namespace Wallabag\CoreBundle\Consumer;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Wallabag\ImportBundle\Consumer; namespace Wallabag\CoreBundle\Consumer;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Wallabag\ImportBundle\Consumer; namespace Wallabag\CoreBundle\Consumer;
use OldSound\RabbitMqBundle\RabbitMq\Consumer; use OldSound\RabbitMqBundle\RabbitMq\Consumer;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Wallabag\ImportBundle\Consumer; namespace Wallabag\CoreBundle\Consumer;
use Simpleue\Job\Job; use Simpleue\Job\Job;

View file

@ -6,8 +6,8 @@ use Craue\ConfigBundle\Util\Config;
use Predis\Client; use Predis\Client;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Wallabag\CoreBundle\Consumer\RabbitMQConsumerTotalProxy;
use Wallabag\CoreBundle\Controller\AbstractController; use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
use Wallabag\ImportBundle\Import\ImportChain; use Wallabag\ImportBundle\Import\ImportChain;
class ImportController extends AbstractController class ImportController extends AbstractController

View file

@ -1,15 +1,15 @@
<?php <?php
namespace Tests\Wallabag\ImportBundle\Consumer; namespace Tests\Wallabag\CoreBundle\Consumer;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Wallabag\CoreBundle\Consumer\AMQPEntryConsumer;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Entity\User;
use Wallabag\CoreBundle\Repository\UserRepository; use Wallabag\CoreBundle\Repository\UserRepository;
use Wallabag\ImportBundle\Consumer\AMQPEntryConsumer;
use Wallabag\ImportBundle\Import\AbstractImport; use Wallabag\ImportBundle\Import\AbstractImport;
class AMQPEntryConsumerTest extends TestCase class AMQPEntryConsumerTest extends TestCase

View file

@ -1,14 +1,14 @@
<?php <?php
namespace Tests\Wallabag\ImportBundle\Consumer; namespace Tests\Wallabag\CoreBundle\Consumer;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Wallabag\CoreBundle\Consumer\RedisEntryConsumer;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Entity\User;
use Wallabag\CoreBundle\Repository\UserRepository; use Wallabag\CoreBundle\Repository\UserRepository;
use Wallabag\ImportBundle\Consumer\RedisEntryConsumer;
use Wallabag\ImportBundle\Import\AbstractImport; use Wallabag\ImportBundle\Import\AbstractImport;
class RedisEntryConsumerTest extends TestCase class RedisEntryConsumerTest extends TestCase