Class humhub\modules\live\driver\Push

Inheritancehumhub\modules\live\driver\Push » humhub\modules\live\driver\BaseDriver » yii\base\BaseObject
Available since version1.3

Database driver for live events

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$jwtKey string The JWT secret key humhub\modules\live\driver\Push
$pushChannel string The used Redis push channel humhub\modules\live\driver\Push
$pushServiceUrl string The URL to the push service humhub\modules\live\driver\Push
$redis \yii\redis\Connection|string|array The Redis \yii\redis\Connection object or the application component ID of the Redis \yii\redis\Connection. humhub\modules\live\driver\Push

Public Methods

Hide inherited methods

MethodDescriptionDefined By
generateJwtAuthorization() Generates an JWT authorization of the current user including the contentContainer id legitmation. humhub\modules\live\driver\Push
getJsConfig() Returns the JavaScript Configuration for this driver humhub\modules\live\driver\Push
init() Initializes the live push component. humhub\modules\live\driver\Push
onContentContainerLegitimationChanged() This callback will be executed whenever the access rules for a contentcontainer is changed. e.g. user joined a new space as member. humhub\modules\live\driver\Push
send() Sends a live event humhub\modules\live\driver\Push

Property Details

$jwtKey public property

The JWT secret key

public string $jwtKey ''
$pushChannel public property

The used Redis push channel

public string $pushChannel 'push'
$pushServiceUrl public property

The URL to the push service

public string $pushServiceUrl ''
$redis public property

The Redis \yii\redis\Connection object or the application component ID of the Redis \yii\redis\Connection. This can also be an array that is used to create a redis \yii\redis\Connection instance in case you do not want do configure redis connection as an application component. After the Cache object is created, if you want to change this property, you should only assign it with a Redis \yii\redis\Connection object.

public \yii\redis\Connection|string|array $redis 'redis'

Method Details

generateJwtAuthorization() public method

Generates an JWT authorization of the current user including the contentContainer id legitmation.

public string generateJwtAuthorization ( )
return string

The JWT string

getJsConfig() public method

Returns the JavaScript Configuration for this driver

public array getJsConfig ( )
return array

The JS Configuratoin

init() public method

Initializes the live push component.

This method will initialize the $redis property to make sure it refers to a valid redis connection.

public void init ( )
throws \yii\base\InvalidConfigException

if $redis is invalid.

onContentContainerLegitimationChanged() public method

This callback will be executed whenever the access rules for a contentcontainer is changed. e.g. user joined a new space as member.

public void onContentContainerLegitimationChanged ( humhub\modules\user\models\User $user, $legitimation = [] )
$user
$legitimation
send() public method

Sends a live event

public boolean send ( humhub\modules\live\components\LiveEvent $liveEvent )
$liveEvent humhub\modules\live\components\LiveEvent

The live event to send

return boolean

Indicates the sent was successful