geksor / yii2-centrifugal
Centrifugo component for Yii2 framework
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/geksor/yii2-centrifugal
Requires
- centrifugal/phpcent: dev-master
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2025-09-22 04:44:34 UTC
README
There is a wrapper for Centrifugo client based on PHPCent
Installation
Run command in shell
> composer require geksor/yii2-centrifugal "dev-master"
or add this line in to the require
section of the composer.json
file in your project
"geksor/yii2-centrifugal": "dev-master"
Setup
Add into your config file as following
'components' => [ ... 'centrifugo' => [ 'class' => 'yii2\centrifugo\Client', 'host' => 'http://localhost:8000', 'secret' => 'very-long-secret-key', 'apiKey' => 'very-long-api-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']);