Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 523e652

Browse filesBrowse files
committed
[FrameworkBundle] fixed the way profiler configuration works
1 parent bfe701a commit 523e652
Copy full SHA for 523e652

File tree

Expand file treeCollapse file tree

1 file changed

+25
-19
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+25
-19
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+25-19Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function mergeConfigs(array $configs)
148148
),
149149
'ide' => null,
150150
'profiler' => array(
151-
'enabled' => true,
151+
'enabled' => false,
152152
'only_exceptions' => null,
153153
'matcher' => array(
154154
'ip' => null,
@@ -203,6 +203,10 @@ protected function mergeConfigs(array $configs)
203203
foreach ($configs as $config) {
204204
$config = $this->normalizeKeys($config);
205205

206+
if (isset($config['profiler'])) {
207+
$config['profiler']['enabled'] = true;
208+
}
209+
206210
if (isset($config['templating']) && is_array($config['templating'])) {
207211
$config['templating']['engines'] = $this->normalizeConfig($config['templating'], 'engine');
208212
$config['templating']['loaders'] = $this->normalizeConfig($config['templating'], 'loader');
@@ -334,28 +338,30 @@ protected function registerEsiConfiguration(array $config, XmlFileLoader $loader
334338
*/
335339
protected function registerProfilerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
336340
{
337-
if ($config['enabled']) {
338-
$loader->load('profiling.xml');
339-
$loader->load('collectors.xml');
341+
if (!$config['enabled']) {
342+
return;
343+
}
340344

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');
344347

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+
}
351351

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);
355358

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']));
359365
}
360366
}
361367
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.