admin/app/common/services/aliyunoss/OSS/Result/AppendResult.php

27 lines
662 B
PHP

<?php
namespace app\common\services\aliyunoss\OSS\Result;
use app\common\services\aliyunoss\OSS\Core\OssException;
/**
* Class AppendResult
* @package OSS\Result
*/
class AppendResult extends Result
{
/**
* Get the value of next-append-position from append's response headers
*
* @return int
* @throws OssException
*/
protected function parseDataFromResponse()
{
$header = $this->rawResponse->header;
if (isset($header["x-oss-next-append-position"])) {
return intval($header["x-oss-next-append-position"]);
}
throw new OssException("cannot get next-append-position");
}
}