sorokinmedia/yii2-centrifugo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sorokinmedia/yii2-centrifugo

Composer 安装命令:

composer require sorokinmedia/yii2-centrifugo

包简介

Centrifugo component for Yii2 framework

README 文档

README

Total Downloads

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-06-12