Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98d4a3e

Browse files
committed
Merge branch '4.2'
* 4.2: Documenting changes recipe 501 - where .env is always loaded
2 parentsac266f0 +6eff406 commit98d4a3e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

‎configuration.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ You can also create a few other ``.env`` files that will be loaded:
269269
``prod`` environment but will *not* be committed to your repository.
270270

271271
If you decide to set real environment variables on production, the ``.env`` files
272-
will *not* be loaded if Symfony detects that a real ``APP_ENV`` environment variable
273-
exists and is set to ``prod``.
272+
*are* still loaded, but your real environment variables will override those values.
274273

275274
Environments & the Other Config Files
276275
-------------------------------------

‎configuration/dot-env-changes.rst‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ important changes:
3030
other environments. You can also create a ``.env.test`` file for test-environment
3131
overrides.
3232

33-
* E) If you pass the ``--env=`` flag when running ``bin/console``, this value will
34-
override your ``APP_ENV`` environment variable (if set). And so, if you pass
35-
``--env=prod``, the DotEnv component *will* try to load your ``.env*`` files.
33+
* E) `One further change to the recipe in January 2019`_ means that your ``.env``
34+
files are *always* loaded, even if you set an ``APP_ENV=prod`` environment
35+
variable. The purpose is for the ``.env`` files to define default values that
36+
you can override if you want to with real environment values.
3637

3738
There are a few other improvements, but these are the most important. To take advantage
3839
of these, you *will* need to modify a few files in your existing app.
@@ -52,7 +53,7 @@ changes can be made to any Symfony 3.4 or higher app:
5253
file. If you've customized this file, make sure to keep those changes (but use
5354
the rest of the changes).
5455

55-
#. Update your `bin/console`_(`bin/console diff`_)file to load the new ``config/bootstrap.php`` file.
56+
#. Update your `bin/console`_ file to load the new ``config/bootstrap.php`` file.
5657

5758
#. Update ``.gitignore``:
5859

@@ -64,6 +65,7 @@ changes can be made to any Symfony 3.4 or higher app:
6465
###> symfony/framework-bundle ###
6566
- /.env
6667
+ /.env.local
68+
+ /.env.local.php
6769
+ /.env.*.local
6870
6971
# ...
@@ -90,7 +92,7 @@ changes can be made to any Symfony 3.4 or higher app:
9092
.. _`public/index.php`:https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/4.2/public/index.php
9193
.. _`index.php diff`:https://github.com/symfony/recipes/compare/8a4e5555e30d5dff64275e2788a901f31a214e79...86e2b6795c455f026e5ab0cba2aff2c7a18511f7#diff-7d73eabd1e5eb7d969ddf9a7ce94f954
9294
.. _`bin/console`:https://github.com/symfony/recipes/blob/master/symfony/console/3.3/bin/console
93-
.. _`bin/console diff`:https://github.com/symfony/recipes/compare/8a4e5555e30d5dff64275e2788a901f31a214e79...f54d6a468405d0d8d27b0e790dc09a01e337777a#diff-2af50efd729ff8e61dcbd936cf2b114b
9495
.. _`comment on the top of .env`:https://github.com/symfony/recipes/blob/master/symfony/flex/1.0/.env
9596
.. _`create a new .env.test`:https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/3.3/.env.test
9697
.. _`phpunit.xml.dist file`:https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/3.3/phpunit.xml.dist
98+
.. _`One further change to the recipe in January 2019`:https://github.com/symfony/recipes/pull/501

‎quick_tour/the_architecture.rst‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,8 @@ as *environment* variables. This means that Symfony works *perfectly* with
288288
Platform as a Service (PaaS) deployment systems as well as Docker.
289289

290290
But setting environment variables while developing can be a pain. That's why your
291-
app automatically loads a ``.env`` file, if the ``APP_ENV`` environment variable
292-
isn't set in the environment. The keys in this file then become environment variables
293-
and are read by your app:
291+
app automatically loads a ``.env`` file. The keys in this file then become environment
292+
variables and are read by your app:
294293

295294
..code-block::bash
296295

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp