Skip to content

Commit ea30f27

Browse files
committed
feature #20618 [DI] Make ContainerBuilder::resolveEnvPlaceholders() able to inline the values of referenced env vars. (nicolas-grekas)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Make ContainerBuilder::resolveEnvPlaceholders() able to inline the values of referenced env vars. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Being able to resolve environment variables at compile time as a replacement for `SYMFONY__` special env vars, unlocking their deprecation (see #20100). Commits ------- 713b081 [DI] Make ContainerBuilder::resolveEnvPlaceholders() able to inline the values of referenced env vars.
2 parents 4b812ab + 949b85b commit ea30f27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,10 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
12481248
if (isset($config['prefix_seed'])) {
12491249
$container->setParameter('cache.prefix.seed', $config['prefix_seed']);
12501250
}
1251+
if ($container->hasParameter('cache.prefix.seed')) {
1252+
// Inline any env vars referenced in the parameter
1253+
$container->setParameter('cache.prefix.seed', $container->resolveEnvPlaceholders($container->getParameter('cache.prefix.seed'), true));
1254+
}
12511255
foreach (array('doctrine', 'psr6', 'redis') as $name) {
12521256
if (isset($config[$name = 'default_'.$name.'_provider'])) {
12531257
$container->setAlias('cache.'.$name, new Alias(Compiler\CachePoolPass::getServiceProvider($container, $config[$name]), false));

0 commit comments

Comments
 (0)