]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
Moved total messages from import
[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.reading_speed', $config['reading_speed']);
23 $container->setParameter('wallabag_core.version', $config['version']);
24 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
25 $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']);
26 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']);
27
28 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
29 $loader->load('services.yml');
30 $loader->load('parameters.yml');
31 }
32
33 public function getAlias()
34 {
35 return 'wallabag_core';
36 }
37 }