ecaretsolutions/scaledroner 问题修复 & 功能扩展

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

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

ecaretsolutions/scaledroner

最新稳定版本:v1.0

Composer 安装命令:

composer require ecaretsolutions/scaledroner

包简介

Official ScaleDrone PHP pushing library

README 文档

README

Official ScaleDrone PHP pushing library. This is a wrapper around the REST API.

Installation

Make sure you have composer installed.

Install it directly:

composer require scaledrone/scaledrone

Or add the following to your composer.json:

{
    "require": {
        "scaledrone/scaledrone": "*"
    }
}

Then update your dependencies:

$ php composer.phar update

Usage

Create a new instance of ScaleDrone passing it the channel_id and secret_key that you can find from the channel's page

$auth = array(
    'channel_id' => 'CHANNEL_ID',
    'secret_key' => 'SECRET_KEY'
);

$client = ScaleDrone\Client::create($auth);

If you wish to connect using a JSON Web Token you can set it like this:

$auth = array(
    'channel_id' => 'CHANNEL_ID',
    'bearer' => 'GENERATED_JWT'
);

$client = ScaleDrone\Client::create($auth);

Publishing a message

$room = 'notifications';
$message = ['email' => 'test2@foo.bar', 'name' => 'php name'];
$response = $client->publish($room, $message);

Channel stats

$response = $client->channel_stats();

Getting the complete list of users from all rooms

$response = $client->members_list();

Getting the list of users in a room

$response = $client->room_members_list('roomName');

Getting the list of rooms and their members

$response = $client->all_room_members_list('roomName');

Running Tests

Clone this repository and change directories to the repository root. Install all dependencies with composer install. Then, just run vendor/bin/phpunit.

统计信息

  • 总下载量: 7.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-24