GetLocationResult.php 615 B

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