Is it possible to listen for Yii events? I want to listen for Yii events like onBeginRequest and onEndRequest. I've tried the following but nothing happens :( 

\Yii::app()-&gt;onBeginRequest = create_function('$event', 'die ("YO") ;');


and 

craft()-&gt;attachEventHandler('onBeginRequest', array($this, 'dieyo'));


and

craft()-&gt;getEventHandlers('onBeginRequest')-&gt;add(array($this, 'dieyo'));


-

public function dieyo($event)
{
    craftdd($event);
}


Thanks in advance
Yii fires the onBeginRequest event before Craft has had a chance to do any of the plugin bootstrapping / initialization, which is why it's not firing in your plugin.