/** * Before action * * @param $event \yii\base\ActionEvent */ public function beforeAction($event) { if (in_array($event->action->id, $this->actions) || in_array('*', $this->actions)) { $sender = $event->sender; $command = $sender->id . '/' . $sender->action->id . $this->getActionParams(); $this->schedule = new CronScheduleModel(); $this->schedule->startCronSchedule($command); $this->setupApplicationErrorHandlers(); } }