@@ -53,7 +53,7 @@ Configuration Formats
5353~~~~~~~~~~~~~~~~~~~~~
5454
5555Unlike other frameworks, Symfony doesn't impose a specific format on you to
56- configure your applications, but lets you choose between YAML, XML and PHP.
56+ configure your applications, but lets you choose between YAML and PHP.
5757Throughout the Symfony documentation, all configuration examples will be
5858shown in these three formats.
5959
@@ -66,20 +66,13 @@ readable. These are the main advantages and disadvantages of each format:
6666
6767* **YAML **: simple, clean and readable, but not all IDEs support autocompletion
6868 and validation for it. :doc: `Learn the YAML syntax </reference/formats/yaml >`;
69- * **XML **: autocompleted/validated by most IDEs and is parsed natively by PHP,
70- but sometimes it generates configuration considered too verbose. `Learn the XML syntax `_;
7169* **PHP **: very powerful and it allows you to create dynamic configuration with
7270 arrays or a :ref: `ConfigBuilder <config-config-builder >`.
7371
74- .. note ::
72+ .. deprecated :: 7.4
7573
76- By default Symfony loads the configuration files defined in YAML and PHP
77- formats. If you define configuration in XML format, update the
78- :method: `Symfony\\ Bundle\\ FrameworkBundle\\ Kernel\\ MicroKernelTrait::configureContainer `
79- and/or
80- :method: `Symfony\\ Bundle\\ FrameworkBundle\\ Kernel\\ MicroKernelTrait::configureRoutes `
81- methods in the ``src/Kernel.php `` file to add support for the ``.xml `` file
82- extension.
74+ The XML format is deprecated in Symfony 7.4 and will be removed in
75+ Symfony 8.0.
8376
8477Importing Configuration Files
8578~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -100,9 +93,9 @@ configuration files, even if they use a different format:
10093 - { resource: '/etc/myapp/*.yaml' }
10194
10295 # ignore_errors: not_found silently discards errors if the loaded file doesn't exist
103- - { resource: 'my_config_file.xml ', ignore_errors: not_found }
96+ - { resource: 'my_config_file.php ', ignore_errors: not_found }
10497 # ignore_errors: true silently discards all errors (including invalid code and not found)
105- - { resource: 'my_other_config_file.xml ', ignore_errors: true }
98+ - { resource: 'my_other_config_file.php ', ignore_errors: true }
10699
107100 # ...
108101
@@ -267,27 +260,6 @@ reusable configuration value. By convention, parameters are defined under the
267260
268261 // ...
269262
270- .. warning ::
271-
272- By default and when using XML configuration, the values between ``<parameter> ``
273- tags are not trimmed. This means that the value of the following parameter will be
274- 275-
276- .. code-block :: xml
277-
278- <parameter key =" app.admin_email" >
279- 280- </parameter >
281-
282- If you want to trim the value of your parameter, use the ``trim `` attribute.
283- When using it, the value of the following parameter will be ``
[email protected] ``:
284-
285- .. code-block :: xml
286-
287- <parameter key =" app.admin_email" trim =" true" >
288- 289- </parameter >
290-
291263 Once defined, you can reference this parameter value from any other
292264configuration file using a special syntax: wrap the parameter name in two ``% ``
293265(e.g. ``%app.admin_email% ``):
@@ -331,7 +303,7 @@ configuration file using a special syntax: wrap the parameter name in two ``%``
331303 'email_address' => param('app.admin_email'),
332304
333305 // ... but if you prefer it, you can also pass the name as a string
334- // surrounded by two % (same as in YAML and XML formats ) and Symfony will
306+ // surrounded by two % (same as in the YAML format ) and Symfony will
335307 // replace it by that parameter value
336308 'email_address' => '%app.admin_email%',
337309 ]);
@@ -1369,7 +1341,6 @@ And all the other topics related to configuration:
13691341
13701342 configuration/*
13711343
1372- .. _`Learn the XML syntax` : https://en.wikipedia.org/wiki/XML
13731344.. _`environment variables` : https://en.wikipedia.org/wiki/Environment_variable
13741345.. _`symbolic links` : https://en.wikipedia.org/wiki/Symbolic_link
13751346.. _`utilities to manage env vars` : https://symfony.com/doc/current/cloud/env.html
0 commit comments