@@ -14,6 +14,9 @@ executes the ``registerContainerConfiguration()`` method of the ``AppKernel``
14
14
class::
15
15
16
16
// app/AppKernel.php
17
+ use Symfony\Component\HttpKernel\Kernel;
18
+ use Symfony\Component\Config\Loader\LoaderInterface;
19
+
17
20
class AppKernel extends Kernel
18
21
{
19
22
// ...
@@ -89,6 +92,9 @@ To make this work, change the code of the
89
92
method::
90
93
91
94
// app/AppKernel.php
95
+ use Symfony\Component\HttpKernel\Kernel;
96
+ use Symfony\Component\Config\Loader\LoaderInterface;
97
+
92
98
class AppKernel extends Kernel
93
99
{
94
100
// ...
@@ -110,7 +116,7 @@ files, including the common files:
110
116
imports :
111
117
- { resource: '../common/config.yml' }
112
118
- { resource: 'parameters.yml' }
113
- - { resource: 'security.yml' }
119
+ - { resource: 'security.yml' }
114
120
115
121
# ...
116
122
@@ -147,9 +153,9 @@ files, including the common files:
147
153
148
154
# app/config/prod/config.yml
149
155
imports :
150
- - { resource: '../common/config.yml' }
156
+ - { resource: '../common/config.yml' }
151
157
- { resource: 'parameters.yml' }
152
- - { resource: 'security.yml' }
158
+ - { resource: 'security.yml' }
153
159
154
160
# ...
155
161
@@ -189,7 +195,7 @@ files, including the common files:
189
195
# app/config/config.yml
190
196
imports :
191
197
- { resource: 'parameters.yml' }
192
- - { resource: 'security.yml' }
198
+ - { resource: 'security.yml' }
193
199
194
200
# ...
195
201
@@ -256,6 +262,9 @@ Again, change the code of the ``registerContainerConfiguration()`` method to
256
262
make Symfony aware of the new file organization::
257
263
258
264
// app/AppKernel.php
265
+ use Symfony\Component\HttpKernel\Kernel;
266
+ use Symfony\Component\Config\Loader\LoaderInterface;
267
+
259
268
class AppKernel extends Kernel
260
269
{
261
270
// ...
@@ -290,9 +299,9 @@ format (``.yml``, ``.xml``, ``.php``, ``.ini``):
290
299
# app/config/config.yml
291
300
imports :
292
301
- { resource: 'parameters.yml' }
293
- - { resource: 'services.xml' }
294
- - { resource: 'security.yml' }
295
- - { resource: 'legacy.php' }
302
+ - { resource: 'services.xml' }
303
+ - { resource: 'security.yml' }
304
+ - { resource: 'legacy.php' }
296
305
297
306
# ...
298
307
@@ -328,24 +337,24 @@ format (``.yml``, ``.xml``, ``.php``, ``.ini``):
328
337
.. caution ::
329
338
330
339
The ``IniFileLoader `` parses the file contents using the
331
- :phpfunction: `parse_ini_file ` function, therefore , you can only set
340
+ :phpfunction: `parse_ini_file ` function. Therefore , you can only set
332
341
parameters to string values. Use one of the other loaders if you want
333
342
to use other data types (e.g. boolean, integer, etc.).
334
343
335
344
If you use any other configuration format, you have to define your own loader
336
345
class extending it from :class: `Symfony\\ Component\\ DependencyInjection\\ Loader\\ FileLoader `.
337
346
When the configuration values are dynamic, you can use the PHP configuration
338
347
file to execute your own logic. In addition, you can define your own services
339
- to load configuration from databases and web services.
348
+ to load configurations from databases or web services.
340
349
341
350
Global Configuration Files
342
351
~~~~~~~~~~~~~~~~~~~~~~~~~~
343
352
344
353
Some system administrators may prefer to store sensitive parameters in files
345
354
outside the project directory. Imagine that the database credentials for your
346
- website are stored in the ``/etc/sites/mysite.com/parameters.yml ``. Loading this
347
- file is as simple as indicating the full file path when importing it from any
348
- other configuration file:
355
+ website are stored in the ``/etc/sites/mysite.com/parameters.yml `` file . Loading
356
+ this file is as simple as indicating the full file path when importing it from
357
+ any other configuration file:
349
358
350
359
.. configuration-block ::
351
360
0 commit comments