File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ whenever the corresponding environment variable is *not* found:
77
77
78
78
# config/services.yaml
79
79
parameters :
80
- env(DATABASE_HOST) : localhost
80
+ env(DATABASE_HOST) : ' localhost'
81
81
82
82
.. code-block :: xml
83
83
@@ -97,6 +97,35 @@ whenever the corresponding environment variable is *not* found:
97
97
// config/services.php
98
98
$container->setParameter('env(DATABASE_HOST)', 'localhost');
99
99
100
+ .. deprecated :: 4.3
101
+
102
+ Passing non-string values as default values for environment variables is no longer supported. Any non-string value,
103
+ e.g. an integer or float must be passed as string.
104
+
105
+ .. code-block :: yaml
106
+
107
+ # config/services.yaml
108
+ parameters :
109
+ env(DATABASE_PORT) : ' 3306'
110
+
111
+ .. code-block :: xml
112
+
113
+ <!-- config/services.xml -->
114
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
115
+ <container xmlns =" http://symfony.com/schema/dic/services"
116
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
117
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd" >
118
+
119
+ <parameters >
120
+ <parameter key =" env(DATABASE_PORT)" >3306</parameter >
121
+ </parameters >
122
+ </container >
123
+
124
+ .. code-block :: php
125
+
126
+ // config/services.php
127
+ $container->setParameter('env(DATABASE_PORT)', '3306');
128
+
100
129
.. _configuration-env-var-in-prod :
101
130
102
131
Configuring Environment Variables in Production
You can’t perform that action at this time.
0 commit comments