]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
9b4703e4370f7bcda0e5241453250d804dbfd5f7
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DependencyInjection / WallabagCoreExtension.php
1 <?php
2
3 namespace Wallabag\CoreBundle\DependencyInjection;
4
5 use Symfony\Component\Config\FileLocator;
6 use Symfony\Component\DependencyInjection\ContainerBuilder;
7 use Symfony\Component\DependencyInjection\Loader;
8 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
10 class WallabagCoreExtension extends Extension
11 {
12 public function load(array $configs, ContainerBuilder $container)
13 {
14 $configuration = new Configuration();
15 $config = $this->processConfiguration($configuration, $configs);
16
17 $container->setParameter('wallabag_core.languages', $config['languages']);
18 $container->setParameter('wallabag_core.items_on_page', $config['items_on_page']);
19 $container->setParameter('wallabag_core.theme', $config['theme']);
20 $container->setParameter('wallabag_core.language', $config['language']);
21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
22 $container->setParameter('wallabag_core.version', $config['version']);
23 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
24
25 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
26 $loader->load('services.yml');
27 }
28
29 public function getAlias()
30 {
31 return 'wallabag_core';
32 }
33 }