1 | <?php |
||
14 | class EnvParametersCompilerPass implements CompilerPassInterface |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * this is a workaround for a new symfony feature: |
||
19 | * https://github.com/symfony/symfony/issues/7555 |
||
20 | * |
||
21 | * we *need* to be able to override any param with our env variables.. |
||
22 | * so we do again, what the kernel did already here.. ;-) |
||
23 | * |
||
24 | * Since fabpot seems to have said bye to this feature we are |
||
25 | * re-implementing it here. We are also adding some fancy json |
||
26 | * parsing for hashes and arrays while at it. |
||
27 | * |
||
28 | * @todo add proper documentation on this "feature" to a README |
||
29 | * |
||
30 | * @param ContainerBuilder $container Container |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | public function process(ContainerBuilder $container) |
||
50 | } |
||
51 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: