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
[DotEnv] Cannot pass .env parameters in bundles config #39625
Comments
I think, you should report this problem to https://github.com/doctrine/DoctrinePHPCRBundle instead. |
This is not related to any specific bundle, I've used DoctrinePHPCRBundle only for illustrative purpose. Any bundle would fail the same way if dotenv parameters would be used. |
The problem is that the extension reads and evaluates a setting ( |
Closing as not a bug in Symfony. |
Symfony version(s) affected: 4/5
Description
Anytime I try pass .env variables to bundle configs I get some sort of hashed values, f.e. for APP_LOCALE=en_US in the DI Extension class the value would be something like
env_a47b1458111e54d0_APP_LOCALE_21afb7caede432771a62c6afa3f24e39
. Which makes some bundles incompatible with environment dependant apps.How to reproduce
.env
with:config/packages/doctrine_phpcr.yaml
with:which will omit exception:
if to add
dd($config['locales']);
before line 394 in DoctrinePHPCRExtension.php the output would be:instead of array.
If using the same approach, but in parameters (add parameter
locales: '%env(json:APP_LOCALES_OBJ)%'
in services.yaml) and access it via container somewhere in the service like$this->container->getParameter('locales');
it will have a valid array value.Possible solution
Don't know one, maybe it is supposed to be like that? But it seems to be quite a big limitation.
The text was updated successfully, but these errors were encountered: