aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/config/default/container/services_twig.yml3
-rw-r--r--phpBB/config/development/config.yml3
-rw-r--r--phpBB/phpbb/di/extension/container_configuration.php8
-rw-r--r--phpBB/phpbb/di/extension/core.php6
4 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/config/default/container/services_twig.yml b/phpBB/config/default/container/services_twig.yml
index fc5f9ba6a1..25382a95a1 100644
--- a/phpBB/config/default/container/services_twig.yml
+++ b/phpBB/config/default/container/services_twig.yml
@@ -41,3 +41,6 @@ services:
- @router
tags:
- { name: twig.extension }
+
+ template.twig.extensions.debug:
+ class: Twig_Extension_Debug
diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml
index 1c17b08931..f451eebe13 100644
--- a/phpBB/config/development/config.yml
+++ b/phpBB/config/development/config.yml
@@ -3,3 +3,6 @@ imports:
core:
require_dev_dependencies: true
+
+ twig:
+ enable_debug_extension: true
diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php
index 1f1c077472..ee58ec2b74 100644
--- a/phpBB/phpbb/di/extension/container_configuration.php
+++ b/phpBB/phpbb/di/extension/container_configuration.php
@@ -30,7 +30,13 @@ class container_configuration implements ConfigurationInterface
$rootNode = $treeBuilder->root('core');
$rootNode
->children()
- ->booleanNode('require_dev_dependencies')->defaultValue(false)->end()
+ ->booleanNode('require_dev_dependencies')->defaultValue(false)->end()
+ ->arrayNode('twig')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->booleanNode('enable_debug_extension')->defaultValue(false)->end()
+ ->end()
+ ->end()
->end()
;
return $treeBuilder;
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
index 72d46fb05b..451efc8e35 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -67,6 +67,12 @@ class core extends Extension
);
}
}
+
+ if ($config['twig']['enable_debug_extension'])
+ {
+ $definition = $container->getDefinition('template.twig.extensions.debug');
+ $definition->addTag('twig.extension');
+ }
}
/**