Столкнулся с такой проблемой - не отрабатывает CConsoleBehavior:
protected/commands/TestCommand.php
Код: Выделить всё
<?php
class TestCommand extends CConsoleCommand
{
public function behaviors(){
return array(
'cron' => array(
'class' => 'application.components.Cron'
)
);
}
public function run() {
echo 'BB';
}
}
Код: Выделить всё
<?php
class Cron extends CConsoleCommandBehavior
{
protected function beforeAction($event)
{
echo 'AA';
}
protected function afterAction($event)
{
echo 'CC';
}
}
Код: Выделить всё
/var/www/test/protected index0h@index0h > ./yiic test
BB