Symfony2 / Doctrine2 : How to override DebugStack class used in doctrine DataCollector? Symfony2 / Doctrine2 : How to override DebugStack class used in doctrine DataCollector? symfony symfony

Symfony2 / Doctrine2 : How to override DebugStack class used in doctrine DataCollector?


All DoctrineBundle classes are configured here: https://github.com/doctrine/DoctrineBundle/blob/master/Resources/config/dbal.xml

You could probably override "doctrine.dbal.logger.profiling.class" with your own implementation like this:

# app/config/config.ymlparameters:    doctrine.dbal.logger.profiling.class: Acme\HelloBundle\Logging\MyDebugStack

And in your class:

namespace Acme\HelloBundle\Logging;use Doctrine\DBAL\Logging\DebugStack;class MyDebugStack extends DebugStack {    //...}

Also, read this section about bundle overriding: http://symfony.com/doc/current/cookbook/bundles/override.html