Get Current Action Of Command

Hi all,

I have recently began using Yii’s console commands (via yiic and CConsoleCommand) to schedule my site’s cron jobs. Is there a way to get the name of the action currently being executed? For controllers on the regular site, I can use:


but there doesn’t appear to be an equivalent for console commands.

I need this because my Cronjob’s run() method returns immediately and there’s no way to update the cronjob’s entry in the DB with it’s completion time, exit code, etc. from the method calling run(). The action within the command class needs to do that update when it finishes execution (but without the name of the action, how do I know which cronjob entry in the DB to update?)



You may always use METHOD or FUNCTION

php magic constants

Of course… Sometimes the obvious gets overlooked. Thanks!