Extension that will be started asap just to init some class object

Hi guys,

I’m developing YII extension to integrate Google Chrome PHP Console extension with YII. I’m not so stupid, but already tired reading many different tutorials about YII ext creation. I need advice from some YII guru.

Extension must be started as soon as possible, means before any other extensions and modules initialization. Extension initialization is very simple, something like:

class PhpConsoleExtension extends <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />?? {

  public function __construct($config) {

    require_once(dirname(__FILE__) . '/PhpConsole.php');

    PhpConsole::start($congig['handleErrors'], $config['handleExceptions'], YII_ROOT_PATH);



The task looks like very simple, but I still can’t find good solution to realize it.

Somebody, please help.

Maybe create a CApplicationComponent and when configuring the extension add it to the preload section of your config file?

How to create "hello world" component - Yii Framework Forum

I have did it by some another way, hope it will work good :)

There is my new extension: http://www.yiiframework.com/extension/php-console/

Right, extending CLogRoute makes perfect sense here. Nice job!