]>
Commit | Line | Data |
---|---|---|
9d50517c NL |
1 | <?php |
2 | ||
ad4d1caa | 3 | namespace Wallabag\CoreBundle\DependencyInjection; |
9d50517c | 4 | |
9d50517c | 5 | use Symfony\Component\Config\FileLocator; |
619cc453 | 6 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
769e19dc | 7 | use Symfony\Component\DependencyInjection\Loader; |
619cc453 | 8 | use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
9d50517c | 9 | |
ad4d1caa | 10 | class WallabagCoreExtension extends Extension |
9d50517c NL |
11 | { |
12 | public function load(array $configs, ContainerBuilder $container) | |
13 | { | |
c89d35e8 NL |
14 | $configuration = new Configuration(); |
15 | $config = $this->processConfiguration($configuration, $configs); | |
bc789687 | 16 | |
c89d35e8 | 17 | $container->setParameter('wallabag_core.languages', $config['languages']); |
bc789687 JB |
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']); | |
bca54859 | 22 | $container->setParameter('wallabag_core.reading_speed', $config['reading_speed']); |
63e40f2d JB |
23 | $container->setParameter('wallabag_core.version', $config['version']); |
24 | $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); | |
b3f4a11a | 25 | $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']); |
24879db1 JB |
26 | $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']); |
27 | $container->setParameter('wallabag_core.list_mode', $config['list_mode']); | |
2297d60f | 28 | $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); |
1c5da417 | 29 | $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']); |
efd351c9 | 30 | $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']); |
426bb453 | 31 | $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']); |
906424c1 | 32 | $container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']); |
c89d35e8 | 33 | |
f808b016 | 34 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
7ffb1e80 | 35 | $loader->load('services.yml'); |
39f27d63 | 36 | $loader->load('parameters.yml'); |
9d50517c NL |
37 | } |
38 | ||
39 | public function getAlias() | |
40 | { | |
ad4d1caa | 41 | return 'wallabag_core'; |
9d50517c NL |
42 | } |
43 | } |