Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Do not enable profiler if xhprof is not installed on server + add ext…
Browse files Browse the repository at this point in the history
…ension required on composer
  • Loading branch information
stephpy committed Oct 15, 2012
1 parent 20dc5b8 commit 069d152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions DependencyInjection/JnsXhprofExtension.php
Expand Up @@ -17,7 +17,7 @@ class JnsXhprofExtension extends Extension
protected $resources = array(
'services' => 'services.xml',
);

/**
* Loads the services based on your application configuration.
*
Expand All @@ -30,9 +30,9 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$config = $processor->process($configuration->getConfigTree(), $configs);

if ($config['enabled']) {
if ($config['enabled'] && function_exists('xhprof_enable')) {
$this->loadDefaults($container);

foreach ($config as $key => $value) {
$container->setParameter($this->getAlias().'.'.$key, $value);
}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -11,7 +11,8 @@
}
],
"require": {
"php": ">=5.3.2"
"php": ">=5.3.2",
"ext-xhprof": "*"
},
"autoload": {
"psr-0": { "Jns\\Bundle\\XhprofBundle": "" }
Expand Down

0 comments on commit 069d152

Please sign in to comment.