AppendResult.php 602 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace OSS\Result;
  3. use OSS\Core\OssException;
  4. /**
  5. * Class AppendResult
  6. * @package OSS\Result
  7. */
  8. class AppendResult extends Result
  9. {
  10. /**
  11. * Get the value of next-append-position from append's 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-next-append-position"])) {
  20. return intval($header["x-oss-next-append-position"]);
  21. }
  22. throw new OssException("cannot get next-append-position");
  23. }
  24. }