@@ -148,7 +148,7 @@ protected function mergeConfigs(array $configs)
148
148
),
149
149
'ide ' => null ,
150
150
'profiler ' => array (
151
- 'enabled ' => true ,
151
+ 'enabled ' => false ,
152
152
'only_exceptions ' => null ,
153
153
'matcher ' => array (
154
154
'ip ' => null ,
@@ -203,6 +203,10 @@ protected function mergeConfigs(array $configs)
203
203
foreach ($ configs as $ config ) {
204
204
$ config = $ this ->normalizeKeys ($ config );
205
205
206
+ if (isset ($ config ['profiler ' ])) {
207
+ $ config ['profiler ' ]['enabled ' ] = true ;
208
+ }
209
+
206
210
if (isset ($ config ['templating ' ]) && is_array ($ config ['templating ' ])) {
207
211
$ config ['templating ' ]['engines ' ] = $ this ->normalizeConfig ($ config ['templating ' ], 'engine ' );
208
212
$ config ['templating ' ]['loaders ' ] = $ this ->normalizeConfig ($ config ['templating ' ], 'loader ' );
@@ -334,28 +338,30 @@ protected function registerEsiConfiguration(array $config, XmlFileLoader $loader
334
338
*/
335
339
protected function registerProfilerConfiguration (array $ config , ContainerBuilder $ container , XmlFileLoader $ loader )
336
340
{
337
- if ($ config ['enabled ' ]) {
338
- $ loader -> load ( ' profiling.xml ' ) ;
339
- $ loader -> load ( ' collectors.xml ' );
341
+ if (! $ config ['enabled ' ]) {
342
+ return ;
343
+ }
340
344
341
- if (isset ($ config ['only_exceptions ' ])) {
342
- $ container ->setParameter ('profiler_listener.only_exceptions ' , $ config ['only_exceptions ' ]);
343
- }
345
+ $ loader ->load ('profiling.xml ' );
346
+ $ loader ->load ('collectors.xml ' );
344
347
345
- if ($ config ['matcher ' ]) {
346
- if (isset ($ config ['matcher ' ]['service ' ])) {
347
- $ container ->setAlias ('profiler.request_matcher ' , $ config ['matcher ' ]['service ' ]);
348
- } elseif (isset ($ config ['matcher ' ]['ip ' ]) || isset ($ config ['matcher ' ]['path ' ])) {
349
- $ definition = $ container ->register ('profiler.request_matcher ' , 'Symfony \\Component \\HttpFoundation \\RequestMatcher ' );
350
- $ definition ->setPublic (false );
348
+ if (isset ($ config ['only_exceptions ' ])) {
349
+ $ container ->setParameter ('profiler_listener.only_exceptions ' , $ config ['only_exceptions ' ]);
350
+ }
351
351
352
- if (isset ($ config ['matcher ' ]['ip ' ])) {
353
- $ definition ->addMethodCall ('matchIp ' , array ($ config ['matcher ' ]['ip ' ]));
354
- }
352
+ if ($ config ['matcher ' ]) {
353
+ if (isset ($ config ['matcher ' ]['service ' ])) {
354
+ $ container ->setAlias ('profiler.request_matcher ' , $ config ['matcher ' ]['service ' ]);
355
+ } elseif (isset ($ config ['matcher ' ]['ip ' ]) || isset ($ config ['matcher ' ]['path ' ])) {
356
+ $ definition = $ container ->register ('profiler.request_matcher ' , 'Symfony \\Component \\HttpFoundation \\RequestMatcher ' );
357
+ $ definition ->setPublic (false );
355
358
356
- if (isset ($ config ['matcher ' ]['path ' ])) {
357
- $ definition ->addMethodCall ('matchPath ' , array ($ config ['matcher ' ]['path ' ]));
358
- }
359
+ if (isset ($ config ['matcher ' ]['ip ' ])) {
360
+ $ definition ->addMethodCall ('matchIp ' , array ($ config ['matcher ' ]['ip ' ]));
361
+ }
362
+
363
+ if (isset ($ config ['matcher ' ]['path ' ])) {
364
+ $ definition ->addMethodCall ('matchPath ' , array ($ config ['matcher ' ]['path ' ]));
359
365
}
360
366
}
361
367
}
0 commit comments