From 7019c7cf6c6af39c0f458769e20c3f9306477943 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 31 Dec 2015 11:24:46 +0100 Subject: Add tagged services for import - list services in /import - add url to import service - ImportBundle routing are now prefixed by /import - optimize flush in each import (flushing each 20 contents) - improve design of each import - add more tests --- .../ImportBundle/Import/ImportCompilerPass.php | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/Wallabag/ImportBundle/Import/ImportCompilerPass.php (limited to 'src/Wallabag/ImportBundle/Import/ImportCompilerPass.php') diff --git a/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php b/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php new file mode 100644 index 00000000..a363a566 --- /dev/null +++ b/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php @@ -0,0 +1,33 @@ +hasDefinition('wallabag_import.chain')) { + return; + } + + $definition = $container->getDefinition( + 'wallabag_import.chain' + ); + + $taggedServices = $container->findTaggedServiceIds( + 'wallabag_import.import' + ); + foreach ($taggedServices as $id => $tagAttributes) { + foreach ($tagAttributes as $attributes) { + $definition->addMethodCall( + 'addImport', + [new Reference($id), $attributes['alias']] + ); + } + } + } +} -- cgit v1.2.3