mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-06 23:48:48 +00:00
cs & fixes
This commit is contained in:
parent
59201088b4
commit
2c61db30b7
6 changed files with 40 additions and 33 deletions
|
@ -246,6 +246,16 @@ old_sound_rabbit_mq:
|
||||||
exchange_options:
|
exchange_options:
|
||||||
name: 'wallabag.import.wallabag_v2'
|
name: 'wallabag.import.wallabag_v2'
|
||||||
type: topic
|
type: topic
|
||||||
|
import_firefox:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.firefox'
|
||||||
|
type: topic
|
||||||
|
import_chrome:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.chrome'
|
||||||
|
type: topic
|
||||||
consumers:
|
consumers:
|
||||||
import_pocket:
|
import_pocket:
|
||||||
connection: default
|
connection: default
|
||||||
|
@ -279,3 +289,19 @@ old_sound_rabbit_mq:
|
||||||
queue_options:
|
queue_options:
|
||||||
name: 'wallabag.import.wallabag_v2'
|
name: 'wallabag.import.wallabag_v2'
|
||||||
callback: wallabag_import.consumer.amqp.wallabag_v2
|
callback: wallabag_import.consumer.amqp.wallabag_v2
|
||||||
|
import_firefox:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.firefox'
|
||||||
|
type: topic
|
||||||
|
queue_options:
|
||||||
|
name: 'wallabag.import.firefox'
|
||||||
|
callback: wallabag_import.consumer.amqp.firefox
|
||||||
|
import_chrome:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.chrome'
|
||||||
|
type: topic
|
||||||
|
queue_options:
|
||||||
|
name: 'wallabag.import.chrome'
|
||||||
|
callback: wallabag_import.consumer.amqp.chrome
|
||||||
|
|
|
@ -15,9 +15,9 @@ class ChromeController extends BrowserController
|
||||||
$service = $this->get('wallabag_import.chrome.import');
|
$service = $this->get('wallabag_import.chrome.import');
|
||||||
|
|
||||||
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
|
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
|
||||||
$service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
|
$service->setProducer($this->get('old_sound_rabbit_mq.import_chrome_producer'));
|
||||||
} elseif ($this->get('craue_config')->get('import_with_redis')) {
|
} elseif ($this->get('craue_config')->get('import_with_redis')) {
|
||||||
$service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
|
$service->setProducer($this->get('wallabag_import.producer.redis.chrome'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $service;
|
return $service;
|
||||||
|
|
|
@ -15,9 +15,9 @@ class FirefoxController extends BrowserController
|
||||||
$service = $this->get('wallabag_import.firefox.import');
|
$service = $this->get('wallabag_import.firefox.import');
|
||||||
|
|
||||||
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
|
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
|
||||||
$service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));
|
$service->setProducer($this->get('old_sound_rabbit_mq.import_firefox_producer'));
|
||||||
} elseif ($this->get('craue_config')->get('import_with_redis')) {
|
} elseif ($this->get('craue_config')->get('import_with_redis')) {
|
||||||
$service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
|
$service->setProducer($this->get('wallabag_import.producer.redis.firefox'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $service;
|
return $service;
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Import;
|
namespace Wallabag\ImportBundle\Import;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Psr\Log\NullLogger;
|
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||||
|
@ -121,7 +118,6 @@ abstract class BrowserImport extends AbstractImport
|
||||||
protected function parseEntriesForProducer(array $entries)
|
protected function parseEntriesForProducer(array $entries)
|
||||||
{
|
{
|
||||||
foreach ($entries as $importedEntry) {
|
foreach ($entries as $importedEntry) {
|
||||||
|
|
||||||
if ((array) $importedEntry !== $importedEntry) {
|
if ((array) $importedEntry !== $importedEntry) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -144,14 +140,15 @@ abstract class BrowserImport extends AbstractImport
|
||||||
*/
|
*/
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((!key_exists('guid', $importedEntry) || (!key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) {
|
if ((!key_exists('guid', $importedEntry) || (!key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) {
|
||||||
$this->parseEntries($importedEntry);
|
$this->parseEntries($importedEntry);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_exists('children', $importedEntry)) {
|
if (key_exists('children', $importedEntry)) {
|
||||||
$this->parseEntries($importedEntry['children']);
|
$this->parseEntries($importedEntry['children']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Import;
|
namespace Wallabag\ImportBundle\Import;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Psr\Log\NullLogger;
|
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
|
||||||
|
|
||||||
class ChromeImport extends BrowserImport
|
class ChromeImport extends BrowserImport
|
||||||
{
|
{
|
||||||
protected $filepath;
|
protected $filepath;
|
||||||
|
@ -58,7 +51,6 @@ class ChromeImport extends BrowserImport
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Import;
|
namespace Wallabag\ImportBundle\Import;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Psr\Log\NullLogger;
|
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
|
||||||
|
|
||||||
class FirefoxImport extends BrowserImport
|
class FirefoxImport extends BrowserImport
|
||||||
{
|
{
|
||||||
protected $filepath;
|
protected $filepath;
|
||||||
|
@ -58,7 +51,6 @@ class FirefoxImport extends BrowserImport
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue