-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Dotenv] Reimplementing symfony/flex' dump-env as a Symfony command #42610
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its also missing tests. See https://github.com/symfony/flex/blob/main/tests/Command/DumpEnvCommandTest.php
Otherwise I'm 👍, it also proved to be sub-optimal for me to have it as a composer plugin command rather than a symfony command.
It would be great if you were also able to submit a PR to https://github.com/symfony/flex for the deprecation of the the command.
Help with this issues please? |
See vimeo/psalm#6337 |
src/Symfony/Bundle/FrameworkBundle/Command/DotenvDumpCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/DotenvDumpCommand.php
Outdated
Show resolved
Hide resolved
Please rebase and squash also (PR should not contain any merge commits) |
We might need to implement symfony/flex#810 in this also. |
@nicolas-grekas Al the work is done, but I can't managed to pass the rebase. Really would appreciate help here. Sorry for been so newbie doing PR. |
@abdielcs I rebased the PR and pushed it on your fork. Please fetch and sync your local copy before moving the command to the component. |
ea949b4
to
e15b003
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased the PR and added a second commit to completly decouple the command from FrameworkBundle.
@abdielcs I saw that you somehow messed up with the git history in previous iterations. As a general rule of thumb, do never ever use git merge
when working on PRs for open-source projects. Use git rebase
instead.
Thank you @abdielcs. |
Awesome thanks a lot! |
…dition (see #6954) Description ----------- We know that Contao is mostly deployed on hosting providers that do not support real environment variables but we also rely on the `Dotenv` component ourselves for e.g. Mailer configuration etc. For performance reasons, on those systems I would like to run `dotenv:dump` so Symfony dumps `.env.local.php` which is way faster as it can be cached in OPCode cache. Of course, you cannot change `.env.local` anymore without also updating that file then. But you will have to add `dotenv:dump` to your deploy chain manually anyway so you'll know that - it doesn't happen just like that. However, the command is not registered by default in Symfony even though it has been around since Symfony 5.4. See symfony/symfony#42610. This means that right now I have to add this configuration to every ME but given the fact of our hosting provider situation, I think this qualifies to be a good default. Again, it just makes sure the command is around, you'll still have to use it yourself. Commits ------- 5f18133 Register the dotenv:dump command by default in the Contao ME 11337ab Adjust service name f236946 Update manager-bundle/config/services.yaml
…dition (see #6954) Description ----------- We know that Contao is mostly deployed on hosting providers that do not support real environment variables but we also rely on the `Dotenv` component ourselves for e.g. Mailer configuration etc. For performance reasons, on those systems I would like to run `dotenv:dump` so Symfony dumps `.env.local.php` which is way faster as it can be cached in OPCode cache. Of course, you cannot change `.env.local` anymore without also updating that file then. But you will have to add `dotenv:dump` to your deploy chain manually anyway so you'll know that - it doesn't happen just like that. However, the command is not registered by default in Symfony even though it has been around since Symfony 5.4. See symfony/symfony#42610. This means that right now I have to add this configuration to every ME but given the fact of our hosting provider situation, I think this qualifies to be a good default. Again, it just makes sure the command is around, you'll still have to use it yourself. Commits ------- 5f181332 Register the dotenv:dump command by default in the Contao ME 11337abd Adjust service name f236946e Update manager-bundle/config/services.yaml
[FrameworkBundle] Reimplementing the symfony/flex env-dump as a symfony command. Most of code copied from https://github.com/symfony/flex/blob/main/src/Command/DumpEnvCommand.php
The command is not registered by default. In order to enable it, one must add it to their
services.yaml
file:On PHP >= 8, the two arguments can be removed when autoconfiguration is enabled (which is the default):