public function __construct(Library\ObjectConfig $config) { //Intercept the events for profiling if ($this->getObject('application')->getCfg('debug')) { //Replace the event dispatcher $this->getObject('manager')->registerAlias('event.dispatcher', 'com:debug.event.profiler'); //Add the database tracer $this->getObject('application.database')->addEventSubscriber('com:debug.event.subscriber.database'); } parent::__construct($config); }