leehom1988/rongcloud-sdk-php

融云服务端SDK,使用PHP实现

1.0.3 2020-04-01 05:30 UTC

This package is auto-updated.

Last update: 2024-10-29 05:22:42 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Join the chat at https://gitter.im/rongcloud-sdk-php/Lobby

融云服务端SDK,使用PHP实现。

本版本是在官方SDK版本基础上开发而成,使用Guzzle替代了cURL请求实现,集成了composer库管理。

安装

推荐使用Composer安装该SDK。关于Composer的使用,请查看该链接Composer

$ composer require leehom1988/rongcloud-sdk-php

运行上面命令,将会自动安装该SDK需要的所有依赖,注意:该SDK需要在PHP5.6.0或更新的版本上运行。

使用

<?php
require 'vendor/autoload.php';

use LeeHom\RongCloud\RongClient;
use LeeHom\RongCloud\Exception\RongCloudException;
use GuzzleHttp\Exception\GuzzleException;

$client = new RongClient('xxxxxxxxxx', 'xxxxxxxxxx');
try {
    $r = $client->User()->getToken('user_id', 'test name', 'http://www.rongcloud.cn/images/logo.png');
    echo $r;
} catch (RongCloudException $e) {
    echo $e->getMessage();
} catch (GuzzleException $e) {
    echo $e->getMessage();
}

About

If you have any question,Please be easy to contact me:

Hope it can help You,Just Enjoy It! 😁😁😁😁

License

The MIT License (MIT). Please see License File for more information.