Nenhuma descrição

rtc_getApp.php 654B

123456789101112131415161718192021222324252627
  1. <?php
  2. require_once __DIR__ . '/../../autoload.php';
  3. use Qiniu\Auth;
  4. use Qiniu\Rtc\AppClient;
  5. // 控制台获取密钥:https://portal.qiniu.com/user/key
  6. $accessKey = getenv('QINIU_ACCESS_KEY');
  7. $secretKey = getenv('QINIU_SECRET_KEY');
  8. $auth = new Auth($accessKey, $secretKey);
  9. $client = new AppClient($auth);
  10. // app 的唯一标识,创建的时候由系统生成
  11. $appId = 'xxxx';
  12. // 获取一个应用当前的配置信息
  13. // 参考文档:https://doc.qnsdk.com/rtn/docs/server_overview#2_1
  14. list($ret, $err) = $client->getApp($appId);
  15. if ($err !== null) {
  16. var_dump($err);
  17. } else {
  18. echo "\n====> $appId Conf: \n";
  19. var_dump($ret);
  20. }