vyants\daemon\DaemonController::beforeAction PHP Method

beforeAction() public method

Prevent non index action running
public beforeAction ( Action $action ) : boolean
$action yii\base\Action
return boolean
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            $this->initLogger();
            if ($action->id != "index") {
                throw new NotSupportedException("Only index action allowed in daemons. So, don't create and call another");
            }
            return true;
        } else {
            return false;
        }
    }