Consloe commands should pass return value from CConsoleCommand::run as process return code

would be better if you could write:

class CustomCmdCommand extends CConsoleCommand {

  public function run( $args ) {

    return 112;



and this should pass returned int as process return code (as in php exit(112) command) so you could check it in system shell:

yiic customCmd

if [ $? == 112 ]; then



now you have to do hacks and call php exit(112) directly which kills all application callstack and can lead to some problems if application stack is not closed properly. It is not very pretty either :)

Interesting suggestion. Please duplicate it as an issue:

done :)