exchange_options:
name: 'wallabag.import.wallabag_v2'
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:
import_pocket:
connection: default
queue_options:
name: 'wallabag.import.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
$service = $this->get('wallabag_import.chrome.import');
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')) {
- $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
+ $service->setProducer($this->get('wallabag_import.producer.redis.chrome'));
}
return $service;
$service = $this->get('wallabag_import.firefox.import');
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')) {
- $service->setProducer($this->get('wallabag_import.producer.redis.wallabag_v1'));
+ $service->setProducer($this->get('wallabag_import.producer.redis.firefox'));
}
return $service;
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;
protected function parseEntriesForProducer(array $entries)
{
foreach ($entries as $importedEntry) {
-
if ((array) $importedEntry !== $importedEntry) {
continue;
}
*/
public function parseEntry(array $importedEntry)
{
-
if ((!key_exists('guid', $importedEntry) || (!key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) {
$this->parseEntries($importedEntry);
+
return;
}
if (key_exists('children', $importedEntry)) {
$this->parseEntries($importedEntry['children']);
+
return;
}
if (!empty($data['created_at'])) {
$dt = new \DateTime();
- $entry->setCreatedAt($dt->setTimestamp($data['created_at']/1000));
+ $entry->setCreatedAt($dt->setTimestamp($data['created_at'] / 1000));
}
$this->em->persist($entry);
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
{
protected $filepath;
return 'import.chrome.description';
}
- /**
+ /**
* {@inheritdoc}
*/
protected function prepareEntry($entry = [])
return $data;
}
-
/**
* {@inheritdoc}
*/
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
{
protected $filepath;
*/
protected function prepareEntry($entry = [])
{
- $data = [
+ $data = [
'title' => $entry['name'],
'html' => '',
'url' => $entry['url'],
'created_at' => $entry['date_added'],
];
- if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
- $data['tags'] = $entry['tags'];
- }
-
- return $data;
- }
+ if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
+ $data['tags'] = $entry['tags'];
+ }
+ return $data;
+ }
/**
* {@inheritdoc}