diff options
-rw-r--r-- | phpBB/phpbb/di/container_builder.php | 16 | ||||
-rw-r--r-- | tests/di/create_container_test.php | 1 | ||||
-rw-r--r-- | tests/di/fixtures/other_config/development/config.yml | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php index 5ad9336695..6216dad978 100644 --- a/phpBB/phpbb/di/container_builder.php +++ b/phpBB/phpbb/di/container_builder.php @@ -195,6 +195,8 @@ class container_builder $loader = new YamlFileLoader($this->container, new FileLocator(phpbb_realpath($this->get_config_path()))); $loader->load(PHPBB_ENVIRONMENT . '/config.yml'); + $this->inject_custom_parameters(); + if ($this->compile_container) { $this->container->compile(); @@ -431,6 +433,20 @@ class container_builder } /** + * Inject the customs parameters into the container + */ + protected function inject_custom_parameters() + { + if ($this->custom_parameters !== null) + { + foreach ($this->custom_parameters as $key => $value) + { + $this->container->setParameter($key, $value); + } + } + } + + /** * Returns the core parameters. * * @return array An array of core parameters diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index ec9828debb..4e47751999 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -146,7 +146,6 @@ namespace $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); $this->assertTrue($container->hasParameter('my_parameter')); - $this->assertFalse($container->hasParameter('core.root_path')); } } } diff --git a/tests/di/fixtures/other_config/development/config.yml b/tests/di/fixtures/other_config/development/config.yml new file mode 100644 index 0000000000..fcfa84f68b --- /dev/null +++ b/tests/di/fixtures/other_config/development/config.yml @@ -0,0 +1,2 @@ +core: + require_dev_dependencies: true |