Console Applications and themes

Hey guys,

In one of my yii application I added theme in to it.Also there is a console application I need to run in cron.But when execute the console app with the theme attribute in main config file it gives me an exception

[color="#FF0000"][color="#FF0000"]" …\…\htdocs\…\cric-alertz1>php protected\console.php UpdateDailyProgress updateSummaryDb exception ‘CException’ with message ‘Property “CConsoleApplication.theme” is not defined.’ in …\…\lib\includes\yii\framework\base\CComponent.php:173 " [/color][/color].

But if i remove the theme attibute from the main and run the app with default theme it runs correctly…Why this is happenning…Also I think there is no connection between console apps and theme as cosole apps runs in dos mode…

Stack trace for this

Stack trace:

#0 …\…\php\lib\includes\yii\framework\base\CModule.php(467): CComponent->__set('t

heme’, ‘green’)

#1 …\…\php\lib\includes\yii\framework\base\CApplication.php(137): CModule->config

ure(Array)

#2 …\…\php\lib\includes\yii\framework\YiiBase.php(118): CApplication->__construct

(’…\…\htdocs…’)

#3 …\…\php\lib\includes\yii\framework\YiiBase.php(105): YiiBase::createApplicatio

n(‘CConsoleApplica…’, ‘…\…\htdocs…’)

#4 …\…\htdocs\…\…\protected\console.php(19): YiiBase::cre

ateConsoleApplication(’…\…\htdocs…’)

#5 {main}

You shouldn’t be using themes or any web-only features in your console applications.

The config is in protected/config/console.php, not in main.

Usually.

Actually I didn’t use any theme in console app; I jst add theme attibute in to protected/config/main.php.But the console application couldn’t run with this attribute in protected/config/main.php file. But if I remove the theme then it’s work properly.

console.php is not using config/main.php - unless you’ve changed it…

Yep…My bad…it had been changed.Any way now it solved.Thanks.