]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Replace RabbitMQ injection with CraueConfiguration
authorNicolas LÅ“uillet <nicolas@loeuillet.org>
Mon, 15 Feb 2016 20:30:55 +0000 (21:30 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 11 Sep 2016 19:57:09 +0000 (21:57 +0200)
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
src/Wallabag/CoreBundle/Command/InstallCommand.php
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
src/Wallabag/ImportBundle/Import/PocketImport.php
src/Wallabag/ImportBundle/Resources/config/services.yml
tests/Wallabag/ImportBundle/Import/PocketImportTest.php

index 48d0ec4b4a082dbea8d794653116ada901c72c35..731e60999fe4ccd5066b63abd9324db4edf155db 100644 (file)
@@ -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
index 143def4f158ea572ad871db1fbbbc2316df3e1e1..8a2439ec7ebb6c3ec242dd3b29eb40c3b5614ba0 100644 (file)
@@ -321,6 +321,11 @@ class InstallCommand extends ContainerAwareCommand
                 'value' => null,
                 'section' => 'import',
             ],
+            [
+                'name' => 'rabbitmq',
+                'value' => '0',
+                'section' => 'import',
+            ],
             [
                 'name' => 'show_printlink',
                 'value' => '1',
index b4309304ecfea459328a239a337d994b36894f7e..778f91edb5001b800b176f3fb9704ed1100ac2a8 100644 (file)
@@ -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',
index b02894f0b56c7d2dff16113f4ebd35828914c59d..7d1c0c617bbc78dc36a58d731e8252bc81925978 100644 (file)
@@ -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;
     }
 
index 7ea54162fb779a19a8fad4d6f0f514eb5093141c..60eb4e1845be7c74c08c5d7f4d0f203c91298260 100644 (file)
@@ -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" ] ]
index a0f943ee80ea652af073444232b950dcbbbb7ab1..5bf47d964086a1f3cce19b533f5ffe55fa29eb69 100644 (file)
@@ -75,7 +75,6 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
             $this->em,
             $this->contentProxy,
             $config,
-            $rabbitMQ,
             $this->producer
         );