InitiateBucketWormResult.php 565 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace OSS\Result;
  3. use OSS\Core\OssException;
  4. /**
  5. * Class InitiateBucketWormResult
  6. * @package OSS\Result
  7. */
  8. class InitiateBucketWormResult extends Result
  9. {
  10. /**
  11. * Get the value of worm-id from response headers
  12. *
  13. * @return int
  14. * @throws OssException
  15. */
  16. protected function parseDataFromResponse()
  17. {
  18. $header = $this->rawResponse->header;
  19. if (isset($header["x-oss-worm-id"])) {
  20. return strval($header["x-oss-worm-id"]);
  21. }
  22. throw new OssException("cannot get worm-id");
  23. }
  24. }