X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FDependencyInjection%2FWallabagCoreExtension.php;h=c075c19fd993c48d6c77ee88bf34f545d8d3e336;hb=b28c5430efefa63d04d87404c99798e82d0427e4;hp=7cc4165efe26366186959a04e81d2221eb171688;hpb=ad4d1caa9e744af57ca58a4e57576533eb682d00;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 7cc4165e..c075c19f 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -2,17 +2,35 @@ 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']); + $container->setParameter('wallabag_core.reading_speed', $config['reading_speed']); + $container->setParameter('wallabag_core.version', $config['version']); + $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); + $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']); + $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']); + $container->setParameter('wallabag_core.list_mode', $config['list_mode']); + $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); + $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']); + + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.yml'); + $loader->load('parameters.yml'); } public function getAlias()