Closed 1ed closed 13 years ago
If you were using the same configuration than the doc, the JMSDebuggingBundle should not even be used in prod.
Here is my AppKernel class... the if ($this->isDebug()) {
is in there:
<?php
//...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
// ....
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle();
}
if ($this->isDebug())
{
$bundles[] = new JMS\DebuggingBundle\JMSDebuggingBundle($this);
$bundles[] = new Elao\WebProfilerExtraBundle\WebProfilerExtraBundle();
}
return $bundles;
}
public function init()
{
if ($this->debug) {
ini_set('display_errors', 1);
error_reporting(-1);
DebugUniversalClassLoader::enable();
ErrorHandler::register();
if ('cli' !== php_sapi_name()) {
ExceptionHandler::register();
}
} else {
ini_set('display_errors', 0);
}
}
protected function getContainerBaseClass()
{
if ($this->isDebug()) {
return '\JMS\DebuggingBundle\DependencyInjection\TraceableContainer';
}
return parent::getContainerBaseClass();
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
you should not activate bundles depending of the debug state as the console can run in prod and in debug mode, which make the bundle fail because they are not configured.
So the doc probably needs to be updated.
Hi!
I got this error when I try run the console in prod. env.:
I'm using BETA4 of Symfony. The DebuggingBundle configuration is the same as in the docs.