|
2 | 2 |
|
3 | 3 | ## Features |
4 | 4 |
|
5 | | -- App |
6 | | - - [x] 创建房间: App->createApp() |
7 | | - - [x] 查看房间: App->getApp() |
8 | | - - [x] 删除房间: App->deleteApp() |
9 | | - - [x] 生成房间token: App->AppToken() |
| 5 | +- Appclient |
| 6 | + - [x] 创建房间: client->createApp() |
| 7 | + - [x] 查看房间: client->getApp() |
| 8 | + - [x] 删除房间: client->deleteApp() |
| 9 | + - [x] 生成房间token: client->AppToken() |
10 | 10 |
|
11 | 11 |
|
12 | 12 |
|
|
31 | 31 | ```php |
32 | 32 | $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; |
33 | 33 | $sk = "xxxx"; |
34 | | -$mac = new QiniuRtc\Mac($ak, $sk); |
35 | | -$client = new QiniuRtc\AppClient($mac); |
| 34 | +$auth = new Auth($ak, $sk); |
| 35 | +$client = new QiniuRtc\AppClient($auth); |
36 | 36 | $resp=$client->createApp("901","testApp"); |
37 | 37 | print_r($resp); |
38 | 38 | ``` |
39 | 39 |
|
40 | | -#### Get a app |
| 40 | +#### Get an app |
41 | 41 |
|
42 | 42 | ```php |
43 | 43 | $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; |
44 | 44 | $sk = "xxxx"; |
45 | | -$mac = new QiniuRtc\Mac($ak, $sk); |
46 | | -$client = new QiniuRtc\AppClient($mac); |
| 45 | +$auth = new Auth($ak, $sk); |
| 46 | +$client = new QiniuRtc\AppClient($auth); |
47 | 47 | $resp=$client->getApp("deq02uhb6"); |
48 | 48 | print_r($resp); |
49 | 49 | ``` |
50 | 50 |
|
51 | | -#### Delete a app |
| 51 | +#### Delete an app |
52 | 52 |
|
53 | 53 | ```php |
54 | 54 | $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; |
55 | 55 | $sk = "xxxx"; |
56 | | -$mac = new QiniuRtc\Mac($ak, $sk); |
57 | | -$client = new QiniuRtc\AppClient($mac); |
| 56 | +$auth = new Auth($ak, $sk); |
| 57 | +$client = new QiniuRtc\AppClient($auth); |
58 | 58 | $resp=$client->deleteApp("deq02uhb6"); |
59 | 59 | print_r($resp); |
60 | 60 | ``` |
61 | 61 |
|
62 | | -#### Generate a app token |
| 62 | +#### Generate an app token |
63 | 63 |
|
64 | 64 | ```php |
65 | 65 | $ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; |
66 | 66 | $sk = "xxxx"; |
67 | | -$mac = new QiniuRtc\Mac($ak, $sk); |
68 | | -$client = new QiniuRtc\AppClient($mac); |
| 67 | +$auth = new Auth($ak, $sk); |
| 68 | +$client = new QiniuRtc\AppClient($auth); |
69 | 69 | $resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user'); |
70 | 70 | print_r($resp); |
71 | 71 | ``` |
0 commit comments