symfony/symfony — pull request #10138 by lavoiesl (2014-01-25 21:25:38+00:00)
Title: [WIP][DependencyInjection] Issue #7555 - Resolve environment variables at runtime

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | minimal
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7555
| License | MIT
| Doc PR | TODO

[x] basic tests
[ ] performance tests
[ ] Deep tests
[ ] documentation

This allows to set a parameter `environment_map` that contains a map `[$parameter => $env_var]`. This allows to call `ParameterBag::resolveEnvironmentMap` even after the bag was initially resolved and frozen. As mentioned by @stof, dependent parameter can not be resolved anymore, so it is forbidden to reference a parameter in the environment map elsewhere.

`HttpKernel` now calls `ParameterBag::resolveEnvironmentMap` after the `Container` was fully loaded.

I am not entirely sure of the implication of this method with the caching mechanism, the cache warmers, etc. I could use some help from someone with a better understanding of the whole thing.

The only BC break is that `environment_map` is not a valid parameter name anymore, it is reserved.