From: Nicolas LÅ“uillet Date: Mon, 15 Feb 2016 20:30:55 +0000 (+0100) Subject: Replace RabbitMQ injection with CraueConfiguration X-Git-Tag: 2.1.0~34^2~29 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=40d2a29443df8ef6fdf1f2d09b5ba8808543c245;p=github%2Fwallabag%2Fwallabag.git Replace RabbitMQ injection with CraueConfiguration --- diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 48d0ec4b..731e6099 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -9,6 +9,7 @@ export_json: Enable JSON export export_txt: Enable TXT export export_xml: Enable XML export pocket_consumer_key: Consumer key for Pocket to import contents (https://getpocket.com/developer/docs/authentication) +rabbitmq: Enable RabbitMQ to import data asynchronously shaarli_url: Shaarli URL, if the service is enabled share_diaspora: Enable share to Diaspora share_mail: Enable share by email diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 143def4f..8a2439ec 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -321,6 +321,11 @@ class InstallCommand extends ContainerAwareCommand 'value' => null, 'section' => 'import', ], + [ + 'name' => 'rabbitmq', + 'value' => '0', + 'section' => 'import', + ], [ 'name' => 'show_printlink', 'value' => '1', diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index b4309304..778f91ed 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -95,6 +95,11 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'value' => null, 'section' => 'import', ], + [ + 'name' => 'rabbitmq', + 'value' => '0', + 'section' => 'import', + ], [ 'name' => 'show_printlink', 'value' => '1', diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index b02894f0..7d1c0c61 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -25,14 +25,14 @@ class PocketImport extends AbstractImport private $producer; private $rabbitMQ; - public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig, $rabbitMQ, Producer $producer) + public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig, Producer $producer) { $this->user = $tokenStorage->getToken()->getUser(); $this->em = $em; $this->contentProxy = $contentProxy; $this->consumerKey = $craueConfig->get('pocket_consumer_key'); $this->logger = new NullLogger(); - $this->rabbitMQ = $rabbitMQ; + $this->rabbitMQ = $craueConfig->get('rabbitmq'); $this->producer = $producer; } diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index 7ea54162..60eb4e18 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -25,7 +25,6 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" - "@craue_config" - - %rabbitmq% - "@old_sound_rabbit_mq.wallabag_producer" calls: - [ setClient, [ "@wallabag_import.pocket.client" ] ] diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php index a0f943ee..5bf47d96 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php @@ -75,7 +75,6 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase $this->em, $this->contentProxy, $config, - $rabbitMQ, $this->producer );