betsuno / yii2-centrifugo
Centrifugo component for Yii2 framework
0.1
2017-02-16 16:11 UTC
Requires
- sl4mmer/phpcent: ^1.0
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2026-03-07 02:59:48 UTC
README
There is a wrapper for Centrifugo client based on PHPCent
Installation
Run command in shell
> php composer.phar require "betsuno/yii2-centrifugo"
or add this line in to the require section of the composer.json file in your project
"betsuno/yii2-centrifugo": "*"
Setup
Add into your config file as following
'components' => [ ... 'centrifugo' => [ 'class' => 'yii2\centrifugo\Client', 'host' => 'http://localhost:8000', 'secret' => 'very-long-secret-key', // also you can specify your own transport class as below 'transport' => [ 'class' => 'your\transport\ClassName', ... ] ], ... ]
Usage
Yii::$app->centrifugo->publish('test', ['message' => 'hello world']);