Skip to content
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

[DI] Unknown env prefix not recognized as such #33960

Merged
merged 1 commit into from Feb 4, 2020
Merged

[DI] Unknown env prefix not recognized as such #33960

merged 1 commit into from Feb 4, 2020

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Oct 11, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

This is a failing test to illustrate the difference between real and fake env vars when using an unknown prefix, followed by the default prefix.

%env(unknown:default::REAL)%
// Unsupported env var prefix "unknown".

%env(unknown:default::FAKE)%
// null

For default::FAKE we get null at

return '' === $default ? null : $this->container->getParameter($default);

which is then preserved at

need inspiration for a patch still :)

@ro0NL ro0NL changed the title [DI] Unknown env prefix not regornized as such [DI] Unknown env prefix not recognized as such Oct 11, 2019
@nicolas-grekas nicolas-grekas added this to the 4.3 milestone Oct 12, 2019
@nicolas-grekas nicolas-grekas modified the milestones: 4.3, 4.4 Feb 1, 2020
@nicolas-grekas nicolas-grekas changed the base branch from 4.3 to 4.4 February 4, 2020 15:57
@nicolas-grekas
Copy link
Member

Thank you @ro0NL.

nicolas-grekas added a commit that referenced this pull request Feb 4, 2020
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[DI] Unknown env prefix not recognized as such

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This is a failing test to illustrate the difference between real and fake env vars when using an unknown prefix, followed by the `default` prefix.

```
%env(unknown:default::REAL)%
// Unsupported env var prefix "unknown".

%env(unknown:default::FAKE)%
// null
```

For `default::FAKE` we get `null` at

https://github.com/symfony/symfony/blob/38b9a27976d36c4ffbfeb9e666319d77ffc8b3c0/src/Symfony/Component/DependencyInjection/EnvVarProcessor.php#L103

which is then preserved at

https://github.com/symfony/symfony/blob/38b9a27976d36c4ffbfeb9e666319d77ffc8b3c0/src/Symfony/Component/DependencyInjection/EnvVarProcessor.php#L123

need inspiration for a patch still :)

Commits
-------

550819a [DI] Unknown env prefix not regornized as such
@nicolas-grekas nicolas-grekas merged commit 550819a into symfony:4.4 Feb 4, 2020
@ro0NL ro0NL deleted the di-env branch February 5, 2020 12:20
This was referenced Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants