sorokinmedia/yii2-centrifugo
Composer 安装命令:
composer require sorokinmedia/yii2-centrifugo
包简介
Centrifugo component for Yii2 framework
README 文档
README
There is a wrapper for Centrifugo client based on PHPCent
Installation
Run command in shell
> php composer.phar require "sorokinmedia/yii2-centrifugo"
or add this line in to the require section of the composer.json file in your project
"sorokinmedia/yii2-centrifugo": "*"
Setup
Add into your config file as following
'components' => [ ... 'centrifugo' => [ 'class' => \sorokinmedia\centrifugo\Client::class, 'host' => 'http://localhost:8000/api', 'secret' => 'very-long-secret-key', 'apikey' => 'very-long-api-ket' ], ... ]
Usage
publish message
Yii::$app->centrifugo->publish('test', ['message' => 'hello world']);
generate jwt token
Yii::$app->centrifugo->generateConnectionToken('5', 0, ['user_id' => 5]);
统计信息
- 总下载量: 14.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-06-12