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:
7777
7878 # config/services.yaml
7979 parameters :
80- env(DATABASE_HOST) : localhost
80+ env(DATABASE_HOST) : ' localhost'
8181
8282 .. code-block :: xml
8383
@@ -97,6 +97,35 @@ whenever the corresponding environment variable is *not* found:
9797 // config/services.php
9898 $container->setParameter('env(DATABASE_HOST)', 'localhost');
9999
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+
100129 .. _configuration-env-var-in-prod :
101130
102131Configuring Environment Variables in Production
You can’t perform that action at this time.
0 commit comments