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
@@ -653,6 +653,12 @@ This example shows how you could configure the database connection using an env
653
653
]);
654
654
};
655
655
656
+ Your env vars may also be accessed in your code thanks to PHP super
657
+ globals ``$_ENV `` and ``$_SERVER ``. Both are equivalent::
658
+
659
+ $databaseUrl = $_ENV['DATABASE_URL']; // mysql://db_user:db_password@127.0.0.1:3306/db_name
660
+ $env = $_SERVER['APP_ENV']; // prod
661
+
656
662
.. versionadded :: 5.3
657
663
658
664
The ``env() `` configurator syntax was introduced in 5.3.
You can’t perform that action at this time.
0 commit comments