File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ Configuration Formats
58
58
~~~~~~~~~~~~~~~~~~~~~
59
59
60
60
Unlike other frameworks, Symfony doesn't impose a specific format on you to
61
- configure your applications, but lets you choose between YAML, XML and PHP.
61
+ configure your applications, but lets you choose between YAML, XML and PHP.
62
62
Throughout the Symfony documentation, all configuration examples will be
63
63
shown in these three formats.
64
64
@@ -721,6 +721,12 @@ This file should be committed to your repository and (due to that fact) should
721
721
only contain "default" values that are good for local development. This file
722
722
should not contain production values.
723
723
724
+ Your env vars can be accessed in your code thanks to PHP super
725
+ globals ``$_ENV `` and ``$_SERVER ``. Both are equivalent::
726
+
727
+ $databaseUrl = $_ENV['DATABASE_URL']; // mysql://db_user:db_password@127.0.0.1:3306/db_name
728
+ $env = $_SERVER['APP_ENV']; // prod
729
+
724
730
In addition to your own env vars, this ``.env `` file also contains the env vars
725
731
defined by the third-party packages installed in your application (they are
726
732
added automatically by :ref: `Symfony Flex <symfony-flex >` when installing packages).
You can’t perform that action at this time.
0 commit comments