-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Env var processor examples for arrays don't work #50341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you try this?
|
The container build doesn't complain with your example anymore, but the array is not resolved: var_dump($container->getParameter('kernel.trusted_hosts'));
// array(1) { [0]=> string(17) "10.0.0.1,10.0.0.2" } And the same for the CLI:
And if I try to configure
|
My example doesn't contain any array. |
Okay, so is the documentation wrong and this cannot be done with the |
Environment placeholders are not supported for all bundle semantic configuration. It depends whether the bundle processes them or passes them as is to the ContainerBuilder. They are supported only when passed as-is (as their value is not known at compile time so any node processing the value is likely to fail or do weird stuff) |
The documentation is completely wrong yes :) Can you please a PR to the doc to fix this? I suppose we need to find another example. |
I went through our whole project, but I can't find anything useful as an example. I'd have to make one up 😄 Maybe some arbitrary list of language codes: parameters:
env(ALLOWED_LANGUAGES): '["en","de","es"]'
app_allowed_languages: '%env(json:ALLOWED_LANGUAGES)%' |
Somewhat related to #50323 |
@nicolas-grekas I've opened a PR with the arbitrary languages example: symfony/symfony-docs#18332 |
Thanks! |
…v var processors (uncaught) This PR was merged into the 5.4 branch. Discussion ---------- [Dotenv] Fix non-working examples of `json` and `csv` env var processors Changes the examples for `json` and `csv` env var processors. The previous examples were not working. Closes symfony/symfony#50341 Commits ------- e73b674 Fix non-working examples of `json` and `csv` env var processors (closes symfony/symfony#50341).
* 5.4: Fix non-working examples of `json` and `csv` env var processors (closes symfony/symfony#50341).
* 6.2: Fix non-working examples of `json` and `csv` env var processors (closes symfony/symfony#50341).
Symfony version(s) affected
symfony/dependency-injection 6.2.10
Description
I'm trying to configure
trusted_headers
/trusted_hosts
via environment variables, but neither thejson
nor thecsv
example work.All I get is:
I've seen #28599 and #27683, but I can't find a solution in them.
Am I missing some component or is the documentation wrong?
How to reproduce
Use one of these in your framework.yaml:
Possible Solution
No response
Additional Context
I've also switch to symfony/flex, so I might miss a component, but the installed EnvVarProcessor seems to include the
json
/csv
handling.The text was updated successfully, but these errors were encountered: