]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
Move default configuration out of parameters
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DependencyInjection / WallabagCoreExtension.php
index 7cc4165efe26366186959a04e81d2221eb171688..73bbffe11bfeb350d7124580ed2d95007e6fa7e8 100644 (file)
@@ -2,17 +2,26 @@
 
 namespace Wallabag\CoreBundle\DependencyInjection;
 
+use Symfony\Component\Config\FileLocator;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader;
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-use Symfony\Component\Config\FileLocator;
 
 class WallabagCoreExtension extends Extension
 {
     public function load(array $configs, ContainerBuilder $container)
     {
-        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
-        $loader->load('services.xml');
+        $configuration = new Configuration();
+        $config = $this->processConfiguration($configuration, $configs);
+
+        $container->setParameter('wallabag_core.languages', $config['languages']);
+        $container->setParameter('wallabag_core.items_on_page', $config['items_on_page']);
+        $container->setParameter('wallabag_core.theme', $config['theme']);
+        $container->setParameter('wallabag_core.language', $config['language']);
+        $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
+
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+        $loader->load('services.yml');
     }
 
     public function getAlias()