From bc78968764c741019a6b866ad434678cdbecbba4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 20 Jan 2016 19:54:57 +0100 Subject: Move default configuration out of parameters These default configuration value shouldn't be in parameters.yml. --- .../CoreBundle/DependencyInjection/Configuration.php | 12 ++++++++++++ .../CoreBundle/DependencyInjection/WallabagCoreExtension.php | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'src/Wallabag/CoreBundle/DependencyInjection') diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index 32acd1f1..4d5a63f8 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php @@ -17,6 +17,18 @@ class Configuration implements ConfigurationInterface ->arrayNode('languages') ->prototype('scalar')->end() ->end() + ->integerNode('items_on_page') + ->defaultValue(12) + ->end() + ->scalarNode('theme') + ->defaultValue('material') + ->end() + ->scalarNode('language') + ->defaultValue('en') + ->end() + ->integerNode('rss_limit') + ->defaultValue(50) + ->end() ->end() ; diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 9ff9b732..73bbffe1 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -13,7 +13,12 @@ class WallabagCoreExtension extends Extension { $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'); -- cgit v1.2.3 From 63e40f2d7c4074aff0be587c828eb511a6b7c878 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 21 Jan 2016 08:53:09 +0100 Subject: Add CraueConfig for internal settings --- src/Wallabag/CoreBundle/DependencyInjection/Configuration.php | 4 ++++ src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src/Wallabag/CoreBundle/DependencyInjection') diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index 4d5a63f8..bc405fdc 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php @@ -29,6 +29,10 @@ class Configuration implements ConfigurationInterface ->integerNode('rss_limit') ->defaultValue(50) ->end() + ->scalarNode('version') + ->end() + ->scalarNode('paypal_url') + ->end() ->end() ; diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 73bbffe1..9b4703e4 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -19,6 +19,8 @@ class WallabagCoreExtension extends Extension $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.version', $config['version']); + $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); -- cgit v1.2.3