aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/DependencyInjection
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/DependencyInjection')
-rw-r--r--src/Wallabag/ImportBundle/DependencyInjection/Configuration.php17
-rw-r--r--src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php b/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php
index bacaff31..3c14104e 100644
--- a/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php
@@ -2,6 +2,7 @@
2 2
3namespace Wallabag\ImportBundle\DependencyInjection; 3namespace Wallabag\ImportBundle\DependencyInjection;
4 4
5use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
5use Symfony\Component\Config\Definition\Builder\TreeBuilder; 6use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6use Symfony\Component\Config\Definition\ConfigurationInterface; 7use Symfony\Component\Config\Definition\ConfigurationInterface;
7 8
@@ -12,6 +13,22 @@ class Configuration implements ConfigurationInterface
12 $treeBuilder = new TreeBuilder(); 13 $treeBuilder = new TreeBuilder();
13 $rootNode = $treeBuilder->root('wallabag_import'); 14 $rootNode = $treeBuilder->root('wallabag_import');
14 15
16 $rootNode
17 ->children()
18 ->arrayNode('importers')
19 ->append($this->getURLs())
20 ->end()
21 ->end()
22 ;
23
15 return $treeBuilder; 24 return $treeBuilder;
16 } 25 }
26
27 private function getURLs()
28 {
29 $node = new ArrayNodeDefinition('pocket_urls');
30 $node->prototype('scalar')->end();
31
32 return $node;
33 }
17} 34}
diff --git a/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php b/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php
index 4efcaace..07dc378d 100644
--- a/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php
+++ b/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php
@@ -13,6 +13,7 @@ class WallabagImportExtension extends Extension
13 { 13 {
14 $configuration = new Configuration(); 14 $configuration = new Configuration();
15 $config = $this->processConfiguration($configuration, $configs); 15 $config = $this->processConfiguration($configuration, $configs);
16 $container->setParameter('wallabag_import.pocket', $config['importers']['pocket_urls']);
16 17
17 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 18 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
18 $loader->load('services.yml'); 19 $loader->load('services.yml');