]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
Update messages.pl.yml
[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.action_mark_as_read', $config['action_mark_as_read']);
27 $container->setParameter('wallabag_core.list_mode', $config['list_mode']);
28 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']);
29 $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']);
30 $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']);
31 $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
32 $container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
33
34 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
35 $loader->load('services.yml');
36 $loader->load('parameters.yml');
37 }
38
39 public function getAlias()
40 {
41 return 'wallabag_core';
42 }
43 }