Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | yes |
RFC? | no |
Symfony version | 4.0.1 |
Dump/cache container | no |
After update from 3.3 to 4.0.1 env values from sub array not resolve to real value on compile container with $resolveEnvPlaceholders=true.
Example yml config:
parameters:
static.domain: '%env(STATIC_DOMAIN)%'
array.static:
domain: '%env(STATIC_DOMAIN)%'
sub:
domain: '%env(STATIC_DOMAIN)%'
services:
demo.env:
class: Project\ProjectDemoEnv
arguments: ['%static.domain%', '%array.static%']
public: true
Class:
<?php
declare(strict_types=1);
namespace Project;
class ProjectDemoEnv
{
public function __construct(string $cdn, array $config)
{
echo 'inline:' . $cdn . "\n";
echo 'fromArray::' . $config['domain'] . "\n";
echo 'fromSubArray::' . $config['sub']['domain'] . "\n";
}
}
inline://static.domain.ru/
fromArray:://static.domain.ru/ fromSubArray::env_STATIC_DOMAIN_190b296f9508e8ebee983c41c97121da - bug
If we try get value from parameter it is work:
echo $container->getParameter('array.static')['sub']['domain']; // //static.domain.ru/
It work correct in 3.3.
Version 3.4 i skip, need check it all version from 3.3.
Note: I can reproduce problem only runtime container without dump/cache container.