Replace RabbitMQ injection with CraueConfiguration

This commit is contained in:
Nicolas Lœuillet 2016-02-15 21:30:55 +01:00 committed by Jeremy Benoist
parent e31ee20dd7
commit 40d2a29443
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
6 changed files with 13 additions and 4 deletions

View 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

View file

@ -321,6 +321,11 @@ class InstallCommand extends ContainerAwareCommand
'value' => null,
'section' => 'import',
],
[
'name' => 'rabbitmq',
'value' => '0',
'section' => 'import',
],
[
'name' => 'show_printlink',
'value' => '1',

View 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',

View 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;
}

View 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" ] ]

View file

@ -75,7 +75,6 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
$this->em,
$this->contentProxy,
$config,
$rabbitMQ,
$this->producer
);