@@ -217,6 +217,47 @@ deployment process too):
217
217
used in your application and prevents Composer from scanning the file system for
218
218
classes that are not found in the class map. (see: `Composer's autoloader optimization `_).
219
219
220
+ Disable Dumping the Container as XML in Debug Mode
221
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222
+
223
+ In debug mode, Symfony compiles the :doc: `service container </service_container >`
224
+ into an XML file. This XML file is used by various commands such as
225
+ ``debug:container `` and ``debug:autowiring ``. When the container grows larger and larger,
226
+ so does the size of the file and the time to generate it. Sometimes the benefit of this
227
+ file does not outweigh the decrease in performance.
228
+
229
+ In these situations, you can disable dumping of the XML file by setting `debug.container.dump ` to `false `:
230
+
231
+ .. configuration-block ::
232
+
233
+ .. code-block :: yaml
234
+
235
+ # config/services.yaml
236
+ parameters :
237
+ # ...
238
+ debug.container.dump : false
239
+
240
+ .. code-block :: xml
241
+
242
+ <!-- config/services.xml -->
243
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
244
+ <container xmlns =" http://symfony.com/schema/dic/services"
245
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
246
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd" >
247
+
248
+ <parameters >
249
+ <!-- ... -->
250
+ <parameter key =" debug.container.dump" >false</parameter >
251
+ </parameters >
252
+ </container >
253
+
254
+ .. code-block :: php
255
+
256
+ // config/services.php
257
+
258
+ // ...
259
+ $container->parameters()->set('debug.container.dump', false);
260
+
220
261
.. _profiling-applications :
221
262
222
263
Profiling Symfony Applications
0 commit comments