Console command access model?

I am trying to create a console command… but I get this error:


exception 'CException' with message 'Property "CConsoleApplication.db" is read only.' in /var/www/flipbook/framework/base/CComponent.php:170

Stack trace:

#0 /var/www/flipbook/framework/base/CModule.php(435): CComponent->__set('db', Array)

#1 /var/www/flipbook/framework/base/CApplication.php(117): CModule->configure(Array)

#2 /var/www/flipbook/framework/YiiBase.php(112): CApplication->__construct('/var/www/flipbo...')

#3 /var/www/flipbook/framework/YiiBase.php(99): YiiBase::createApplication('CConsoleApplica...', '/var/www/flipbo...')

#4 /var/www/flipbook/protected/console.php(10): YiiBase::createConsoleApplication('/var/www/flipbo...')



My config for console is this:


<?php

// This is the configuration for yiic console application.

// Any writable CConsoleApplication properties can be configured here.

return array(

    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

    'name'=>'Ebook Console Application',

    // autoloading model and component classes

    'import'=>array(

        'application.models.*'

    ),


    'db'=>array(

        'connectionString' => 'mysql:host=localhost;dbname=ebooks',

        'emulatePrepare' => true,

        'username' => 'root',

        'password' => '123qwe',

        'charset' => 'utf8',

    ),

);

Does anybody know what is wrong with this :unsure:

You are missing the components array.




'components' => array(

   'db' => array(

      ...

   ),

),



:blink: arggh thx…

Btw what is the reason to have different config files for console and main and test?

Only for performance reasons?