diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2014-11-25 17:04:15 +0100 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-05-04 14:43:58 +0200 |
| commit | f821130c3a4a22efd491aaad962cc84a82dde56a (patch) | |
| tree | 49b79a2cbe5283210667bd1da9495694c5296863 /phpBB/phpbb/di | |
| parent | 6be8841a5732009e28c2362b197e4492c6ea8aa7 (diff) | |
| download | forums-f821130c3a4a22efd491aaad962cc84a82dde56a.tar forums-f821130c3a4a22efd491aaad962cc84a82dde56a.tar.gz forums-f821130c3a4a22efd491aaad962cc84a82dde56a.tar.bz2 forums-f821130c3a4a22efd491aaad962cc84a82dde56a.tar.xz forums-f821130c3a4a22efd491aaad962cc84a82dde56a.zip | |
[ticket/12632] Add twig.debug and twig.auto_reload in config.yml
PHPBB3-13206
PHPBB3-12632
Diffstat (limited to 'phpBB/phpbb/di')
| -rw-r--r-- | phpBB/phpbb/di/extension/container_configuration.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/di/extension/core.php | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php index ee58ec2b74..4cc7c7c0d1 100644 --- a/phpBB/phpbb/di/extension/container_configuration.php +++ b/phpBB/phpbb/di/extension/container_configuration.php @@ -34,6 +34,8 @@ class container_configuration implements ConfigurationInterface ->arrayNode('twig') ->addDefaultsIfNotSet() ->children() + ->booleanNode('debug')->defaultValue(null)->end() + ->booleanNode('auto_reload')->defaultValue(null)->end() ->booleanNode('enable_debug_extension')->defaultValue(false)->end() ->end() ->end() diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index c71dc61280..c9e2d4dc5b 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -69,6 +69,20 @@ class core extends Extension } } + // Set the Twig options if defined in the environment + $definition = $container->getDefinition('template.twig.environment'); + $twig_environment_options = $definition->getArgument(6); + if ($config['twig']['debug']) + { + $twig_environment_options['debug'] = true; + } + if ($config['twig']['auto_reload']) + { + $twig_environment_options['auto_reload'] = true; + } + // Replace the 6th argument, the options passed to the environment + $definition->replaceArgument(6, $twig_environment_options); + if ($config['twig']['enable_debug_extension']) { $definition = $container->getDefinition('template.twig.extensions.debug'); |
