You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
732 B

6 years ago
  1. <?php
  2. namespace OSS\Result;
  3. use OSS\Core\OssException;
  4. /**
  5. * Class AclResult getBucketAcl接口返回结果类,封装了
  6. * 返回的xml数据的解析
  7. *
  8. * @package OSS\Result
  9. */
  10. class AclResult extends Result
  11. {
  12. /**
  13. * @return string
  14. * @throws OssException
  15. */
  16. protected function parseDataFromResponse()
  17. {
  18. $content = $this->rawResponse->body;
  19. if (empty($content)) {
  20. throw new OssException("body is null");
  21. }
  22. $xml = simplexml_load_string($content);
  23. if (isset($xml->AccessControlList->Grant)) {
  24. return strval($xml->AccessControlList->Grant);
  25. } else {
  26. throw new OssException("xml format exception");
  27. }
  28. }
  29. }