yuncms/broadcast-qcloud

The qcloud broadcast for yuncms.

1.0.0.2 2018-03-10 06:40 UTC

This package is auto-updated.

Last update: 2022-01-10 20:49:41 UTC


README

适用于 YUNCMS 的 QCloud CMQ 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-qcloud

or add

"yuncms/broadcast-qcloud": "~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\qcloud\Broadcast',
        'endPoint' => 'http://cmq-topic-sh.api.qcloud.com/',
        'topicName' => 'abc',
        'secretId' => '',
        'secretKey' => '',
    ],
],

Use

使用方式非常简单

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


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

var_dump($res);