Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Updating docs for .env changes#10680
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
22 changes: 15 additions & 7 deletionsbest_practices/configuration.rst
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
46 changes: 32 additions & 14 deletionsconfiguration.rst
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
91 changes: 91 additions & 0 deletionsconfiguration/dot-env-changes.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| Nov 2018 Changes to .env & How to Update | ||
| ======================================== | ||
| In November 2018, several changes were made to the core Symfony *recipes* related | ||
| to the ``.env`` file. These changes make working with environment variables easier | ||
| and more consistent - especially when writing functional tests. | ||
| If your app was started before November 2018, your app **does not require any changes | ||
| to keep working**. However, if/when you are ready to take advantage of these improvements, | ||
| you will need to make a few small updates. | ||
| What Changed Exactly? | ||
| --------------------- | ||
| But first, what changed? On a high-level, not much. Here's a summary of the most | ||
| important changes: | ||
| * A) The ``.env.dist`` file no longer exists. Its contents should be moved to your | ||
| ``.env`` file (see the next point). | ||
| * B) The ``.env`` file **is** now commited to your repository. It was previously ignored | ||
| via the ``.gitignore`` file (the updated recipe does not ignore this file). Because | ||
| this file is committed, it should contain non-sensitive, default values. Basically, | ||
| the ``.env.dist`` file was moved to ``.env``. | ||
| * C) A ``.env.local`` file can now be created to *override* environment variables for | ||
| your machine. This file is ignored in the new ``.gitignore``. | ||
| * D) When testing, your ``.env`` file is now read, making it consistent with all | ||
| other environments. You can also create a ``.env.test`` file for test-environment | ||
| overrides. | ||
| There are a few other improvements, but these are the most important. To take advantage | ||
| of these, you *will* need to modify a few files in your existing app. | ||
| Updating My Application | ||
| ----------------------- | ||
| If you created your application after November 15th 2018, you don't need to make | ||
| any changes! Otherwise, here is the list of changes you'll need to make - these | ||
| changes can be made to any Symfony 3.4 or higher app: | ||
| #. Create a new `src/.bootstrap.php`_ file in your project. This file loads Composer's | ||
| autoloader and loads all the ``.env`` files as needed. | ||
| #. Update your `public/index.php`_ (`index.php diff`_) file to load the new ``src/.bootstrap.php`` | ||
| file. If you've customized this file, make sure to keep those changes (but use | ||
| the rest of the changes). | ||
| #. Update your `bin/console`_ (`bin/console diff`_) file to load the new ``src/.bootstrap.php`` file. | ||
| #. Update ``.gitignore``: | ||
| .. code-block:: diff | ||
| # .gitignore | ||
| # ... | ||
| ###> symfony/framework-bundle ### | ||
| - /.env | ||
| + /.env.local | ||
| + /.env.*.local | ||
| # ... | ||
| #. Rename ``.env`` to ``.env.local`` and ``.env.dist`` to ``.env``: | ||
| .. code-block:: terminal | ||
| # Unix | ||
| $ mv .env .env.local | ||
| $ git mv .env.dist .env | ||
| # Windows | ||
| $ mv .env .env.local | ||
| $ git mv .env.dist .env | ||
| You can also update the `comment on the top of .env`_ to reflect the new changes. | ||
| #. If you're using PHPUnit, you will also need to `create a new .env.test`_ file | ||
| and update your `phpunit.xml.dist file`_ so it loads the ``src/.bootstrap.php`` | ||
| file. | ||
| .. _`src/.bootstrap.php`: https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/src/.bootstrap.php | ||
| .. _`public/index.php`: https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/public/index.php | ||
| .. _`index.php diff`: https://github.com/symfony/recipes/compare/8a4e5555e30d5dff64275e2788a901f31a214e79...86e2b6795c455f026e5ab0cba2aff2c7a18511f7#diff-473fca613b5bda15d87731036cb31586 | ||
| .. _`bin/console`: https://github.com/symfony/recipes/blob/master/symfony/console/3.3/bin/console | ||
| .. _`bin/console diff`: https://github.com/symfony/recipes/compare/8a4e5555e30d5dff64275e2788a901f31a214e79...86e2b6795c455f026e5ab0cba2aff2c7a18511f7#diff-2af50efd729ff8e61dcbd936cf2b114b | ||
| .. _`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 |
14 changes: 5 additions & 9 deletionsconfiguration/environments.rst
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
8 changes: 4 additions & 4 deletionsdeployment.rst
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
2 changes: 1 addition & 1 deletiondoctrine.rst
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
2 changes: 1 addition & 1 deletiondoctrine/dbal.rst
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
2 changes: 1 addition & 1 deletiondoctrine/reverse_engineering.rst
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
2 changes: 2 additions & 0 deletionsemail.rst
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
1 change: 0 additions & 1 deletionquick_tour/the_big_picture.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -29,7 +29,6 @@ Symfony application: | ||
| quick_tour/ | ||
| ├─ .env | ||
| ├─ bin/console | ||
| ├─ composer.json | ||
| ├─ composer.lock | ||
2 changes: 1 addition & 1 deletionsecurity/force_https.rst
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
40 changes: 28 additions & 12 deletionstesting.rst
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
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.