-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Updating docs for a few more .env changes #10793
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
1) .env being always loaded after proposed recipe 2) A new command to dump an optimized version of those env vars 3) A new command to update your recipes
* E) If you pass the ``--env=`` flag when running ``bin/console``, this value will | ||
override your ``APP_ENV`` environment variable (if set). And so, if you pass | ||
``--env=prod``, the DotEnv component *will* try to load your ``.env*`` files. | ||
* E) `One further change to the recipe in December 2019`_ means that your ``.env`` |
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.
Should it be
* E) `One further change to the recipe in December 2019`_ means that your ``.env`` | |
* E) `One further change to the recipe in December 2018`_ means that your ``.env`` |
?
|
||
.. code-block:: terminal | ||
|
||
# Unix |
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.
Why have 2 sections when the commands are the same for Unix and Windows?
Summary of the Changes | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
IF you want to manually update your application, here the details: these changes |
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.
IF you want to manually update your application, here the details: these changes | |
If you want to manually update your application, here the details: these changes |
@@ -94,3 +134,4 @@ changes can be made to any Symfony 3.4 or higher app: | |||
.. _`comment on the top of .env`: https://github.com/symfony/recipes/blob/master/symfony/flex/1.0/.env | |||
.. _`create a new .env.test`: https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/3.3/.env.test | |||
.. _`phpunit.xml.dist file`: https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/3.3/phpunit.xml.dist | |||
.. _`One further change to the recipe in December 2019`: https://github.com/symfony/recipes/pull/501 |
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.
.. _`One further change to the recipe in December 2019`: https://github.com/symfony/recipes/pull/501 | |
.. _`One further change to the recipe in December 2018`: https://github.com/symfony/recipes/pull/501 |
…loaded (weaverryan) This PR was merged into the 4.1 branch. Discussion ---------- Documenting changes recipe 501 - where .env is always loaded See symfony/recipes#501 This basically documents *part* of what is included in #10793. That PR also documents the Flex `composer sync-recipes --force` and `composer dump-env prod` commands, neither of which exist yet. When those are merged / tagged, I'll finish that PR. Note: after merging to 4.2, the URLs at the bottom of `dot-env-changes` need to be changed to point to the 4.2 recipes. Thanks! Commits ------- 203d93a Documenting changes recipe 501 - where .env is always loaded
All related PRs have been merged, so we can work on finishing this. Thanks! |
your recipes, so it will probably include other changes beyond the ones needed for | ||
the new environment handling. | ||
|
||
First, rename ``.env`` to ``.env.local`` and ``.env.dist`` to ``.env``: |
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.
not sure this is needed: the command already does the rename, isn't it?
$ git mv .env.dist .env | ||
|
||
# Windows | ||
$ mv .env .env.local |
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.
if we keep it, it's rename
on windows? or we rely on the fact that if git is installed, so is mv
?
Closing as fixed by #11690. |
There are a few more proposed .env changes. Yes, I know - I'm hoping these are the last ones, to finally have a simple, non-changing solution :).
The overall picture now looks like this:
A)
.env
files are always loaded. Simple. No exceptions, no logic.B) When deploying, there is an optional command in Flex to dump your
.env
files to an optimized version, if you don't want the overhead of reading these at runtime or don't want DotEnv to be installed on production.References: