Fix dump-env command when .env files reference other env vars#1070
Merged
nicolas-grekas merged 1 commit into2.xfrom Nov 16, 2025
Merged
Fix dump-env command when .env files reference other env vars#1070nicolas-grekas merged 1 commit into2.xfrom
nicolas-grekas merged 1 commit into2.xfrom
Conversation
Member
Author
|
We might also want to make http-kernel conflict with affected versions of flex so that ppl are forced to update flex when moving to 7.4 and don't fall into this issue. |
d21af52 to
ed41273
Compare
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Nov 16, 2025
…ekas) This PR was merged into the 7.4 branch. Discussion ---------- [HttpKernel] Conflict with symfony/flex < 2.10 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT symfony/flex#1070 is a mandatory fix to have the new `APP_SHARE_DIR` env var work correctly. This will also encourage people to change their flex requirement: at the moment, it's very easy to forget to bump to `^2` when your project already has a `^1` constraint. Yet, flex v1 isn't maintained anymore. Commits ------- af9703c [HttpKernel] Conflict with symfony/flex < 2.10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment, running
composer dump-envon a 7.4 project generates a brokenAPP_SHARE_DIR.The reason is that since symfony/recipes#1465 we define that var as
"$APP_PROJECT_DIR/var/share"Yet, when the command runs, all env vars are emptied to make the result context-free.
This fixes it by hooking into calls to the
getenv()function.