cdn_get_log_list.php 658 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. require_once __DIR__ . '/../autoload.php';
  3. use \Qiniu\Cdn\CdnManager;
  4. $accessKey = getenv('QINIU_ACCESS_KEY');
  5. $secretKey = getenv('QINIU_SECRET_KEY');
  6. $auth = new Qiniu\Auth($accessKey, $secretKey);
  7. $cdnManager = new CdnManager($auth);
  8. $domains = array(
  9. "javasdk.qiniudn.com",
  10. "phpsdk.qiniudn.com"
  11. );
  12. $logDate = '2017-08-20';
  13. //获取日志下载链接
  14. //参考文档:http://developer.qiniu.com/article/fusion/api/log.html
  15. list($logListData, $getLogErr) = $cdnManager->getCdnLogList($domains, $logDate);
  16. if ($getLogErr != null) {
  17. var_dump($getLogErr);
  18. } else {
  19. echo "get cdn log list success\n";
  20. print_r($logListData);
  21. }