br0sk/yii2-pusher

Pusher的Yii2封装器

安装次数: 13,714

依赖者: 0

建议者: 0

安全: 0

星标: 5

关注者: 4

分支: 1

公开问题: 0

类型:yii2-extension

1.0.0 2017-12-13 21:13 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:09:42 UTC


README

一个针对Pusher.com的Yii2扩展

这是一个为Yii2提供的扩展,使使用Pusher变得简单。

您可以在应用程序的components配置中配置它,如下所示

'pusher' => [
    'class' => 'br0sk\pusher\Pusher',
    /*
     * Mandatory parameters.
     */
    'appId' => 'YOUR_APP_ID',
    'appKey' => 'YOUR_APP_KEY',
    'appSecret' => 'YOUR_APP_SECRET',
    /*
     * Optional parameters.
     */
    'options' => ['encrypted' => true, 'cluster' => 'YOUR_APP_CLUSTER']
],

注意:通过点击您要使用的应用程序,在您的账户中找到配置详细信息。

典型用法的示例

Yii::$app->pusher->push('my-channel', 'my_event', 'hello world');

此扩展是pusher-http-php的封装器