How to create command in module?


How to create CConsoleCommand in module? Is there a way to do it?


I create this structure :

Config in affiliate_cron.php is pointing to this :


Command "php.exe affiliate_cron.php stats" is running, but my module is using model, that placed in /protected/models/, so error appeared :

2010/09/28 13:11:32 [error] [php] YiiBase::include(Downloads.php): failed to open stream: No such file or directory (c:\yii\framework\YiiBase.php:338)

Tried to add application models to import section in affiliate/config/cron.php, but nothing changed :

'import' => array(



How can I include (import) Downloads.php to module?


Does anyone have an answer for this? I’m looking to do the same.