diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-10-23 14:01:27 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-02 23:24:17 +0100 |
commit | ff7b031d5792f7b6fd43b508d89397775bd1433c (patch) | |
tree | 7a7c515e8d4ff774ccbdb12845d235b3e1cfbfd2 /src/Wallabag/ImportBundle/DependencyInjection | |
parent | 1f4408de9ed08f3b0fda45a93f1585c80feeb21d (diff) | |
download | wallabag-ff7b031d5792f7b6fd43b508d89397775bd1433c.tar.gz wallabag-ff7b031d5792f7b6fd43b508d89397775bd1433c.tar.zst wallabag-ff7b031d5792f7b6fd43b508d89397775bd1433c.zip |
refactor pocket import
Diffstat (limited to 'src/Wallabag/ImportBundle/DependencyInjection')
-rw-r--r-- | src/Wallabag/ImportBundle/DependencyInjection/Configuration.php | 17 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php | 25 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php b/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php new file mode 100644 index 00000000..bacaff31 --- /dev/null +++ b/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php | |||
@@ -0,0 +1,17 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ImportBundle\DependencyInjection; | ||
4 | |||
5 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
6 | use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
7 | |||
8 | class Configuration implements ConfigurationInterface | ||
9 | { | ||
10 | public function getConfigTreeBuilder() | ||
11 | { | ||
12 | $treeBuilder = new TreeBuilder(); | ||
13 | $rootNode = $treeBuilder->root('wallabag_import'); | ||
14 | |||
15 | return $treeBuilder; | ||
16 | } | ||
17 | } | ||
diff --git a/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php b/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php new file mode 100644 index 00000000..4efcaace --- /dev/null +++ b/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php | |||
@@ -0,0 +1,25 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ImportBundle\DependencyInjection; | ||
4 | |||
5 | use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
6 | use Symfony\Component\Config\FileLocator; | ||
7 | use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
8 | use Symfony\Component\DependencyInjection\Loader; | ||
9 | |||
10 | class WallabagImportExtension extends Extension | ||
11 | { | ||
12 | public function load(array $configs, ContainerBuilder $container) | ||
13 | { | ||
14 | $configuration = new Configuration(); | ||
15 | $config = $this->processConfiguration($configuration, $configs); | ||
16 | |||
17 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
18 | $loader->load('services.yml'); | ||
19 | } | ||
20 | |||
21 | public function getAlias() | ||
22 | { | ||
23 | return 'wallabag_import'; | ||
24 | } | ||
25 | } | ||