yuncms/broadcast-aliyun

The aliyun broadcast for yuncms.

1.0.0.2 2018-03-10 06:40 UTC

This package is auto-updated.

Last update: 2022-01-10 21:14:02 UTC


README

适用于 YUNCMS 的 Aliyun MNS Topic。使用了DI实现的,可自行继承扩展。

Latest Stable Version Total Downloads License

Installation

Next steps will guide you through the process of installing using composer. Installation is a quick and easy three-step process.

Step 1: Install component via composer

Either run

composer require --prefer-dist yuncms/broadcast-aliyun

or add

"yuncms/broadcast-aliyun": "~1.0.0"

to the require section of your composer.json.

Step 2: Configuring your application

Add following lines to your main configuration file:

'components' => [
    'broadcast' => [
        'class' => 'yuncms\broadcast\aliyun\Broadcast',
        'endPoint' => 'http://a13.mns.cn-hangzhou.aliyuncs.com/',
        'topicName' => 'abc',
        'accessId' => '',
        'accessKey' => '',
    ],
],

Use

使用方式非常简单

$broadcast = Yii::$app->broadcast;


$res = $broadcast->send([
    'Key'=>'value',
    //etc ...
]);

var_dump($res);