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.

28 lines
593 B

6 years ago
  1. <?php
  2. namespace OSS\Result;
  3. use OSS\Core\OssException;
  4. /**
  5. * Class initiateMultipartUploadResult
  6. * @package OSS\Result
  7. */
  8. class InitiateMultipartUploadResult extends Result
  9. {
  10. /**
  11. * 结果中获取uploadId并返回
  12. *
  13. * @throws OssException
  14. * @return string
  15. */
  16. protected function parseDataFromResponse()
  17. {
  18. $content = $this->rawResponse->body;
  19. $xml = simplexml_load_string($content);
  20. if (isset($xml->UploadId)) {
  21. return strval($xml->UploadId);
  22. }
  23. throw new OssException("cannot get UploadId");
  24. }
  25. }