Skip to content

[FrameworkBundle] Don't load the profiler when it is disabled #7071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Truly disabled profiler in prod
  • Loading branch information
dlsniper committed Feb 23, 2013
commit 7783ea6ddf125fedddbac366913294d19390ed3b
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerValidationConfiguration($config['validation'], $container, $loader);
$this->registerEsiConfiguration($config['esi'], $container, $loader);
$this->registerFragmentsConfiguration($config['fragments'], $container, $loader);
$this->registerProfilerConfiguration($config['profiler'], $container, $loader);

if (isset($config['profiler']) && isset($config['profiler']['enabled']) && $config['profiler']['enabled']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First isset is unnecessary, isn't it?

$this->registerProfilerConfiguration($config['profiler'], $container, $loader);
}

$this->registerTranslatorConfiguration($config['translator'], $container);

if (isset($config['router'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class WebProfilerExtension extends Extension
*/
public function load(array $configs, ContainerBuilder $container)
{
if (!$container->hasParameter('profiler.class')) {
return;
}

$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);

Expand Down