aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/di/extension
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/di/extension')
-rw-r--r--phpBB/phpbb/di/extension/container_configuration.php11
-rw-r--r--phpBB/phpbb/di/extension/core.php8
-rw-r--r--phpBB/phpbb/di/extension/tables.php59
3 files changed, 78 insertions, 0 deletions
diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php
index 4585d6509e..57e7ef6ca6 100644
--- a/phpBB/phpbb/di/extension/container_configuration.php
+++ b/phpBB/phpbb/di/extension/container_configuration.php
@@ -31,10 +31,15 @@ class container_configuration implements ConfigurationInterface
$rootNode
->children()
->booleanNode('require_dev_dependencies')->defaultValue(false)->end()
+ ->booleanNode('allow_install_dir')->defaultValue(false)->end()
->arrayNode('debug')
->addDefaultsIfNotSet()
->children()
->booleanNode('exceptions')->defaultValue(false)->end()
+ ->booleanNode('load_time')->defaultValue(false)->end()
+ ->booleanNode('sql_explain')->defaultValue(false)->end()
+ ->booleanNode('memory')->defaultValue(false)->end()
+ ->booleanNode('show_errors')->defaultValue(false)->end()
->end()
->end()
->arrayNode('twig')
@@ -45,6 +50,12 @@ class container_configuration implements ConfigurationInterface
->booleanNode('enable_debug_extension')->defaultValue(false)->end()
->end()
->end()
+ ->arrayNode('session')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->booleanNode('log_errors')->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 67150f0103..0497c90e2a 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -71,6 +71,8 @@ class core extends Extension
}
}
+ $container->setParameter('allow_install_dir', $config['allow_install_dir']);
+
// Set the Twig options if defined in the environment
$definition = $container->getDefinition('template.twig.environment');
$twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION);
@@ -97,6 +99,12 @@ class core extends Extension
{
$container->setParameter('debug.' . $name, $value);
}
+
+ // Set the log options
+ foreach ($config['session'] as $name => $value)
+ {
+ $container->setParameter('session.' . $name, $value);
+ }
}
/**
diff --git a/phpBB/phpbb/di/extension/tables.php b/phpBB/phpbb/di/extension/tables.php
new file mode 100644
index 0000000000..40684b6038
--- /dev/null
+++ b/phpBB/phpbb/di/extension/tables.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\di\extension;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
+/**
+ * Container tables extension
+ */
+class tables extends Extension
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ // Tables is a reserved parameter and will be overwritten at all times
+ $tables = [];
+
+ // Add access via 'tables' parameter to acquire array with all tables
+ $parameterBag = $container->getParameterBag();
+ $parameters = $parameterBag->all();
+ foreach ($parameters as $parameter_name => $parameter_value)
+ {
+ if (!preg_match('/tables\.(.+)/', $parameter_name, $matches))
+ {
+ continue;
+ }
+
+ $tables[$matches[1]] = $parameter_value;
+ }
+
+ $container->setParameter('tables', $tables);
+ }
+
+ /**
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
+ public function getAlias()
+ {
+ return 'tables';
+ }
+}