4
4
Configuring Symfony (and Environments)
5
5
======================================
6
6
7
- Every Symfony application consists of a collection of bundles that add useful tools
8
- (:doc: `services </service_container >`) to your project. Each bundle can be customized
9
- via configuration files that live - by default - in the ``config/ `` directory.
7
+ Symfony applications can install third-party packages (bundles, libraries, etc.)
8
+ to bring in new features (:doc: `services </service_container >`) to your project.
9
+ Each package can be customized via configuration files that live - by default -
10
+ in the ``config/ `` directory.
10
11
11
12
Configuration: config/packages/
12
13
-------------------------------
13
14
14
15
The configuration for each package can be found in ``config/packages/ ``. For
15
- instance, the framework package is configured in ``config/packages/framework.yaml ``:
16
+ instance, the framework bundle is configured in ``config/packages/framework.yaml ``:
16
17
17
18
.. configuration-block ::
18
19
@@ -91,8 +92,8 @@ There are *two* ways to know *what* keys you can configure:
91
92
#. Use the :doc: `Reference Section </reference/index >`;
92
93
#. Use the ``config:dump-reference `` command.
93
94
94
- For example, if you want to configure something in Framework, you can see an example
95
- dump of all available configuration options by running:
95
+ For example, if you want to configure something related to the framework bundle,
96
+ you can see an example dump of all available configuration options by running:
96
97
97
98
.. code-block :: terminal
98
99
@@ -192,8 +193,8 @@ This parameter is then referenced in the framework config in
192
193
));
193
194
194
195
You can define whatever parameter names you want under the ``parameters `` key of
195
- any configuration file. To reference a parameter, surround its name with two percent
196
- signs - e.g. ``%locale% ``.
196
+ any configuration file. To reference a parameter, surround its name with two
197
+ percent signs - e.g. ``%locale% ``.
197
198
198
199
.. seealso ::
199
200
@@ -209,9 +210,9 @@ a controller - see :ref:`service-container-parameters`.
209
210
The .env File
210
211
~~~~~~~~~~~~~
211
212
212
- There is also a ``.env `` file which is loaded. Its contents become environment variables
213
- in the dev environment, making it easier to reference environment variables in your
214
- code.
213
+ There is also a ``.env `` file which is loaded. Its contents become environment
214
+ variables in the dev environment, making it easier to reference environment
215
+ variables in your code.
215
216
216
217
The ``.env `` file is special, because it defines the values that usually change
217
218
on each server. For example, the database credentials on your local development
@@ -229,19 +230,20 @@ in sync.
229
230
Environments & the Other Config Files
230
231
-------------------------------------
231
232
232
- You have just *one * app, but whether you realize it or not, you need it to behave
233
- *differently * at different times:
233
+ You have just *one * app, but whether you realize it or not, you need it to
234
+ behave *differently * at different times:
234
235
235
- * While **developing **, you want your app to log everything and expose nice debugging
236
- tools;
236
+ * While **developing **, you want your app to log everything and expose nice
237
+ debugging tools;
237
238
238
- * After deploying to **production **, you want that *same * app to be optimized for
239
- speed and only log errors.
239
+ * After deploying to **production **, you want that *same * app to be optimized
240
+ for speed and only log errors.
240
241
241
- How can you make *one * application behave in two different ways? With *environments *.
242
+ How can you make *one * application behave in two different ways? With
243
+ *environments *.
242
244
243
- You've probably already been using the ``dev `` environment without even knowing it.
244
- After you deploy, you'll use the ``prod `` environment.
245
+ You've probably already been using the ``dev `` environment without even knowing
246
+ it. After you deploy, you'll use the ``prod `` environment.
245
247
246
248
To learn more about *how * to execute and control each environment, see
247
249
:doc: `/configuration/environments `.
0 commit comments