public function getIsConsoleRequest()
    {
        if ($this->_isConsoleRequest === null && \Yii::$app !== null) {
            if (\Yii::$app->getRequest() instanceof ConsoleRequest) {
                $this->_isConsoleRequest = true;
            } elseif (\Yii::$app->getRequest() instanceof WebRequest) {
                $this->_isConsoleRequest = false;
            }
        }
        if ($this->_isConsoleRequest === null) {
            throw new InvalidConfigException('Unable to determine if the application is a console or web application.');
        }

        return $this->_isConsoleRequest;
    }
public function getIsConsoleRequest()
    {
        if ($this->_isConsoleRequest === null && \Yii::$app !== null) {
            if (\Yii::$app->getRequest() instanceof ConsoleRequest) {
                $this->_isConsoleRequest = true;
            } elseif (\Yii::$app->getRequest() instanceof WebRequest) {
                $this->_isConsoleRequest = false;
            }
        }
        if ($this->_isConsoleRequest === null) {
            throw new InvalidConfigException('Unable to determine if the application is a console or web application.');
        }

        return $this->_isConsoleRequest;
    }
public function getIsConsoleRequest ( ) { if ( $ this -> _isConsoleRequest === null && \ Yii :: $ app !== null ) { if ( \ Yii :: $ app -> getRequest ( ) instanceof ConsoleRequest ) { $ this -> _isConsoleRequest = true ; } elseif ( \ Yii :: $ app -> getRequest ( ) instanceof WebRequest ) { $ this -> _isConsoleRequest = false ; } } if ( $ this -> _isConsoleRequest === null ) { throw new InvalidConfigException ( 'Unable to determine if the application is a console or web application.' ) ; } return $ this -> _isConsoleRequest ; }
Returns whether the current request is a console request.
@return bool whether the current request is a console request.
@throws InvalidConfigException if unable to determine.
Returns whether the current request is a console request .