Browse files

Do not enable profiler if xhprof is not installed on server + add ext…

…ension required on composer
  • Loading branch information...
1 parent 20dc5b8 commit 069d152379fcada6fb6859bfbcd6df3ac6653527 @stephpy stephpy committed Oct 15, 2012
Showing with 5 additions and 4 deletions.
  1. +3 −3 DependencyInjection/JnsXhprofExtension.php
  2. +2 −1 composer.json
View
6 DependencyInjection/JnsXhprofExtension.php
@@ -17,7 +17,7 @@ class JnsXhprofExtension extends Extension
protected $resources = array(
'services' => 'services.xml',
);
-
+
/**
* Loads the services based on your application configuration.
*
@@ -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);
}
View
3 composer.json
@@ -11,7 +11,8 @@
}
],
"require": {
- "php": ">=5.3.2"
+ "php": ">=5.3.2",
+ "ext-xhprof": "*"
},
"autoload": {
"psr-0": { "Jns\\Bundle\\XhprofBundle": "" }

0 comments on commit 069d152

Please sign in to comment.