Tentative de régler le bordel
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
59
phpbb/di/extension/tables.php
Normal file
59
phpbb/di/extension/tables.php
Normal file
@@ -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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user