最新服务器上的版本,以后用这个
wangzhenxin
2023-11-19 bc164b8bdbfbdf1d8229a5ced6b08d7cb8db7361
commit | author | age
2207d6 1 # Rtc Streaming Cloud Server-Side Library For PHP
W 2
3 ## Features
4
5 - Appclient
6     - [x] 创建房间: client->createApp()
7     - [x] 查看房间: client->getApp()
8     - [x] 删除房间: client->deleteApp()
9     - [x] 生成房间token: client->appToken()
10
11
12
13 ## Contents
14
15 - [Installation](#installation)
16 - [Usage](#usage)
17     - [Configuration](#configuration)
18     - [App](#app)
19         - [Create a app](#create-a-app)
20         - [Get a app](#get-a-app)
21         - [Delete a app](#delete-a-app)
22         - [Generate a app token](#generate-a-app-token)
23
24
25 ## Usage
26
27 ### App
28
29 #### Create a app
30
31 ```php
32 $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
33 $sk = "xxxx";
34 $auth = new Auth($ak, $sk);
35 $client = new Qiniu\Rtc\AppClient($auth);
36 $resp=$client->createApp("901","testApp");
37 print_r($resp);
38 ```
39
40 #### Get an app
41
42 ```php
43 $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
44 $sk = "xxxx";
45 $auth = new Auth($ak, $sk);
46 $client = new Qiniu\Rtc\AppClient($auth);
47 $resp=$client->getApp("deq02uhb6");
48 print_r($resp);
49 ```
50
51 #### Delete an app
52
53 ```php
54 $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
55 $sk = "xxxx";
56 $auth = new Auth($ak, $sk);
57 $client = new Qiniu\Rtc\AppClient($auth);
58 $resp=$client->deleteApp("deq02uhb6");
59 print_r($resp);
60 ```
61
62 #### Generate an app token
63
64 ```php
65 $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
66 $sk = "xxxx";
67 $auth = new Auth($ak, $sk);
68 $client = new Qiniu\Rtc\AppClient($auth);
69 $resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user');
70 print_r($resp);
71 ```