asepindra/yii2-new-pusher

Pusher 的 Yii2 封装

安装: 71

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分叉: 0

开放问题: 1

类型:yii2-extension

1.2 2022-04-21 04:28 UTC

This package is auto-updated.

Last update: 2024-09-21 10:00:43 UTC


README

一个用于 Pusher.com 的 Yii2 扩展

这是一个为 Yii2 优化的 Pusher 使用扩展,使得使用 Pusher 变得更加方便。

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

'pusher' => [
    'class' => 'asepindra\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 的封装