Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

31
vendor/oss-sdk/src/OSS/Result/AclResult.php vendored Executable file
View File

@@ -0,0 +1,31 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* The type of the return value of getBucketAcl, it wraps the data parsed from xml.
*
* @package OSS\Result
*/
class AclResult extends Result
{
/**
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
if (isset($xml->AccessControlList->Grant)) {
return strval($xml->AccessControlList->Grant);
} else {
throw new OssException("xml format exception");
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace OSS\Result;
use 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");
}
}

19
vendor/oss-sdk/src/OSS/Result/BodyResult.php vendored Executable file
View File

@@ -0,0 +1,19 @@
<?php
namespace OSS\Result;
/**
* Class BodyResult
* @package OSS\Result
*/
class BodyResult extends Result
{
/**
* @return string
*/
protected function parseDataFromResponse()
{
return empty($this->rawResponse->body) ? "" : $this->rawResponse->body;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace OSS\Result;
/**
* Class CallbackResult
* @package OSS\Result
*/
class CallbackResult extends PutSetDeleteResult
{
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace OSS\Result;
/**
* Class CopyObjectResult
* @package OSS\Result
*/
class CopyObjectResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = $this->rawResponse->body;
$xml = simplexml_load_string($body);
$result = array();
if (isset($xml->LastModified)) {
$result[] = $xml->LastModified;
}
if (isset($xml->ETag)) {
$result[] = $xml->ETag;
}
return $result;
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace OSS\Result;
/**
* Class DeleteObjectsResult
* @package OSS\Result
*/
class DeleteObjectsResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = $this->rawResponse->body;
$xml = simplexml_load_string($body);
$objects = array();
if (isset($xml->Deleted)) {
foreach($xml->Deleted as $deleteKey)
$objects[] = $deleteKey->Key;
}
return $objects;
}
}

34
vendor/oss-sdk/src/OSS/Result/ExistResult.php vendored Executable file
View File

@@ -0,0 +1,34 @@
<?php
namespace OSS\Result;
/**
* Class ExistResult checks if bucket or object exists, according to the http status in response headers.
* @package OSS\Result
*/
class ExistResult extends Result
{
/**
* @return bool
*/
protected function parseDataFromResponse()
{
return intval($this->rawResponse->status) === 200 ? true : false;
}
/**
* Check if the response status is OK according to the http status code.
* [200-299]: OK; [404]: Not found. It means the object or bucket is not found--it's a valid response too.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace OSS\Result;
use OSS\Model\CnameConfig;
class GetCnameResult extends Result
{
/**
* @return CnameConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new CnameConfig();
$config->parseFromXml($content);
return $config;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace OSS\Result;
use OSS\Model\CorsConfig;
class GetCorsResult extends Result
{
/**
* @return CorsConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new CorsConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Check if the response is OK, according to the http status. [200-299]:OK, the Cors config could be got; [404]: not found--no Cors config.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace OSS\Result;
use OSS\Model\LifecycleConfig;
/**
* Class GetLifecycleResult
* @package OSS\Result
*/
class GetLifecycleResult extends Result
{
/**
* Parse the LifecycleConfig object from the response
*
* @return LifecycleConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new LifecycleConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Check if the response is OK according to the http status.
* [200-299]: OK, and the LifecycleConfig could be got; [404] The Life cycle config is not found.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelHistory;
class GetLiveChannelHistoryResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelHistory();
$channelList->parseFromXml($content);
return $channelList;
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelInfo;
class GetLiveChannelInfoResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelInfo();
$channelList->parseFromXml($content);
return $channelList;
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelStatus;
class GetLiveChannelStatusResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelStatus();
$channelList->parseFromXml($content);
return $channelList;
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class GetLocationResult getBucketLocation interface returns the result class, encapsulated
* The returned xml data is parsed
*
* @package OSS\Result
*/
class GetLocationResult extends Result
{
/**
* Parse data from response
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
return $xml;
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace OSS\Result;
use OSS\Model\LoggingConfig;
/**
* Class GetLoggingResult
* @package OSS\Result
*/
class GetLoggingResult extends Result
{
/**
* Parse LoggingConfig data
*
* @return LoggingConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new LoggingConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace OSS\Result;
use OSS\Model\RefererConfig;
/**
* Class GetRefererResult
* @package OSS\Result
*/
class GetRefererResult extends Result
{
/**
* Parse RefererConfig data
*
* @return RefererConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new RefererConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class AclResult GetBucketAcl interface returns the result class, encapsulated
* The returned xml data is parsed
*
* @package OSS\Result
*/
class GetStorageCapacityResult extends Result
{
/**
* Parse data from response
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
if (isset($xml->StorageCapacity)) {
return intval($xml->StorageCapacity);
} else {
throw new OssException("xml format exception");
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace OSS\Result;
use OSS\Model\WebsiteConfig;
/**
* Class GetWebsiteResult
* @package OSS\Result
*/
class GetWebsiteResult extends Result
{
/**
* Parse WebsiteConfig data
*
* @return WebsiteConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new WebsiteConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace OSS\Result;
/**
* Class HeaderResult
* @package OSS\Result
* @link https://docs.aliyun.com/?spm=5176.383663.13.7.HgUIqL#/pub/oss/api-reference/object&GetObjectMeta
*/
class HeaderResult extends Result
{
/**
* The returned ResponseCore header is used as the return data
*
* @return array
*/
protected function parseDataFromResponse()
{
return empty($this->rawResponse->header) ? array() : $this->rawResponse->header;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class initiateMultipartUploadResult
* @package OSS\Result
*/
class InitiateMultipartUploadResult extends Result
{
/**
* Get uploadId in result and return
*
* @throws OssException
* @return string
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
if (isset($xml->UploadId)) {
return strval($xml->UploadId);
}
throw new OssException("cannot get UploadId");
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace OSS\Result;
use OSS\Model\BucketInfo;
use OSS\Model\BucketListInfo;
/**
* Class ListBucketsResult
*
* @package OSS\Result
*/
class ListBucketsResult extends Result
{
/**
* @return BucketListInfo
*/
protected function parseDataFromResponse()
{
$bucketList = array();
$content = $this->rawResponse->body;
$xml = new \SimpleXMLElement($content);
if (isset($xml->Buckets) && isset($xml->Buckets->Bucket)) {
foreach ($xml->Buckets->Bucket as $bucket) {
$bucketInfo = new BucketInfo(strval($bucket->Location),
strval($bucket->Name),
strval($bucket->CreationDate));
$bucketList[] = $bucketInfo;
}
}
return new BucketListInfo($bucketList);
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace OSS\Result;
use OSS\Model\LiveChannelListInfo;
class ListLiveChannelResult extends Result
{
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new LiveChannelListInfo();
$channelList->parseFromXml($content);
return $channelList;
}
}

View File

@@ -0,0 +1,55 @@
<?php
namespace OSS\Result;
use OSS\Core\OssUtil;
use OSS\Model\ListMultipartUploadInfo;
use OSS\Model\UploadInfo;
/**
* Class ListMultipartUploadResult
* @package OSS\Result
*/
class ListMultipartUploadResult extends Result
{
/**
* Parse the return data from the ListMultipartUpload interface
*
* @return ListMultipartUploadInfo
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
$encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
$bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
$keyMarker = isset($xml->KeyMarker) ? strval($xml->KeyMarker) : "";
$keyMarker = OssUtil::decodeKey($keyMarker, $encodingType);
$uploadIdMarker = isset($xml->UploadIdMarker) ? strval($xml->UploadIdMarker) : "";
$nextKeyMarker = isset($xml->NextKeyMarker) ? strval($xml->NextKeyMarker) : "";
$nextKeyMarker = OssUtil::decodeKey($nextKeyMarker, $encodingType);
$nextUploadIdMarker = isset($xml->NextUploadIdMarker) ? strval($xml->NextUploadIdMarker) : "";
$delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
$delimiter = OssUtil::decodeKey($delimiter, $encodingType);
$prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$maxUploads = isset($xml->MaxUploads) ? intval($xml->MaxUploads) : 0;
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$listUpload = array();
if (isset($xml->Upload)) {
foreach ($xml->Upload as $upload) {
$key = isset($upload->Key) ? strval($upload->Key) : "";
$key = OssUtil::decodeKey($key, $encodingType);
$uploadId = isset($upload->UploadId) ? strval($upload->UploadId) : "";
$initiated = isset($upload->Initiated) ? strval($upload->Initiated) : "";
$listUpload[] = new UploadInfo($key, $uploadId, $initiated);
}
}
return new ListMultipartUploadInfo($bucket, $keyMarker, $uploadIdMarker,
$nextKeyMarker, $nextUploadIdMarker,
$delimiter, $prefix, $maxUploads, $isTruncated, $listUpload);
}
}

View File

@@ -0,0 +1,71 @@
<?php
namespace OSS\Result;
use OSS\Core\OssUtil;
use OSS\Model\ObjectInfo;
use OSS\Model\ObjectListInfo;
use OSS\Model\PrefixInfo;
/**
* Class ListObjectsResult
* @package OSS\Result
*/
class ListObjectsResult extends Result
{
/**
* Parse the xml data returned by the ListObjects interface
*
* return ObjectListInfo
*/
protected function parseDataFromResponse()
{
$xml = new \SimpleXMLElement($this->rawResponse->body);
$encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
$objectList = $this->parseObjectList($xml, $encodingType);
$prefixList = $this->parsePrefixList($xml, $encodingType);
$bucketName = isset($xml->Name) ? strval($xml->Name) : "";
$prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$marker = isset($xml->Marker) ? strval($xml->Marker) : "";
$marker = OssUtil::decodeKey($marker, $encodingType);
$maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
$delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
$delimiter = OssUtil::decodeKey($delimiter, $encodingType);
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$nextMarker = isset($xml->NextMarker) ? strval($xml->NextMarker) : "";
$nextMarker = OssUtil::decodeKey($nextMarker, $encodingType);
return new ObjectListInfo($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList);
}
private function parseObjectList($xml, $encodingType)
{
$retList = array();
if (isset($xml->Contents)) {
foreach ($xml->Contents as $content) {
$key = isset($content->Key) ? strval($content->Key) : "";
$key = OssUtil::decodeKey($key, $encodingType);
$lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
$eTag = isset($content->ETag) ? strval($content->ETag) : "";
$type = isset($content->Type) ? strval($content->Type) : "";
$size = isset($content->Size) ? intval($content->Size) : 0;
$storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
$retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass);
}
}
return $retList;
}
private function parsePrefixList($xml, $encodingType)
{
$retList = array();
if (isset($xml->CommonPrefixes)) {
foreach ($xml->CommonPrefixes as $commonPrefix) {
$prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$retList[] = new PrefixInfo($prefix);
}
}
return $retList;
}
}

View File

@@ -0,0 +1,42 @@
<?php
namespace OSS\Result;
use OSS\Model\ListPartsInfo;
use OSS\Model\PartInfo;
/**
* Class ListPartsResult
* @package OSS\Result
*/
class ListPartsResult extends Result
{
/**
* Parse the xml data returned by the ListParts interface
*
* @return ListPartsInfo
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
$bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
$key = isset($xml->Key) ? strval($xml->Key) : "";
$uploadId = isset($xml->UploadId) ? strval($xml->UploadId) : "";
$nextPartNumberMarker = isset($xml->NextPartNumberMarker) ? intval($xml->NextPartNumberMarker) : "";
$maxParts = isset($xml->MaxParts) ? intval($xml->MaxParts) : "";
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$partList = array();
if (isset($xml->Part)) {
foreach ($xml->Part as $part) {
$partNumber = isset($part->PartNumber) ? intval($part->PartNumber) : "";
$lastModified = isset($part->LastModified) ? strval($part->LastModified) : "";
$eTag = isset($part->ETag) ? strval($part->ETag) : "";
$size = isset($part->Size) ? intval($part->Size) : "";
$partList[] = new PartInfo($partNumber, $lastModified, $eTag, $size);
}
}
return new ListPartsInfo($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, $partList);
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace OSS\Result;
use OSS\Model\LiveChannelInfo;
class PutLiveChannelResult extends Result
{
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channel = new LiveChannelInfo();
$channel->parseFromXml($content);
return $channel;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace OSS\Result;
/**
* Class PutSetDeleteResult
* @package OSS\Result
*/
class PutSetDeleteResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = array('body' => $this->rawResponse->body);
return array_merge($this->rawResponse->header, $body);
}
}

175
vendor/oss-sdk/src/OSS/Result/Result.php vendored Executable file
View File

@@ -0,0 +1,175 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
use OSS\Http\ResponseCore;
/**
* Class Result, The result class of The operation of the base class, different requests in dealing with the return of data have different logic,
* The specific parsing logic postponed to subclass implementation
*
* @package OSS\Model
*/
abstract class Result
{
/**
* Result constructor.
* @param $response ResponseCore
* @throws OssException
*/
public function __construct($response)
{
if ($response === null) {
throw new OssException("raw response is null");
}
$this->rawResponse = $response;
$this->parseResponse();
}
/**
* Get requestId
*
* @return string
*/
public function getRequestId()
{
if (isset($this->rawResponse) &&
isset($this->rawResponse->header) &&
isset($this->rawResponse->header['x-oss-request-id'])
) {
return $this->rawResponse->header['x-oss-request-id'];
} else {
return '';
}
}
/**
* Get the returned data, different request returns the data format is different
*
* $return mixed
*/
public function getData()
{
return $this->parsedData;
}
/**
* Subclass implementation, different requests return data has different analytical logic, implemented by subclasses
*
* @return mixed
*/
abstract protected function parseDataFromResponse();
/**
* Whether the operation is successful
*
* @return mixed
*/
public function isOK()
{
return $this->isOk;
}
/**
* @throws OssException
*/
public function parseResponse()
{
$this->isOk = $this->isResponseOk();
if ($this->isOk) {
$this->parsedData = $this->parseDataFromResponse();
} else {
$httpStatus = strval($this->rawResponse->status);
$requestId = strval($this->getRequestId());
$code = $this->retrieveErrorCode($this->rawResponse->body);
$message = $this->retrieveErrorMessage($this->rawResponse->body);
$body = $this->rawResponse->body;
$details = array(
'status' => $httpStatus,
'request-id' => $requestId,
'code' => $code,
'message' => $message,
'body' => $body
);
throw new OssException($details);
}
}
/**
* Try to get the error message from body
*
* @param $body
* @return string
*/
private function retrieveErrorMessage($body)
{
if (empty($body) || false === strpos($body, '<?xml')) {
return '';
}
$xml = simplexml_load_string($body);
if (isset($xml->Message)) {
return strval($xml->Message);
}
return '';
}
/**
* Try to get the error Code from body
*
* @param $body
* @return string
*/
private function retrieveErrorCode($body)
{
if (empty($body) || false === strpos($body, '<?xml')) {
return '';
}
$xml = simplexml_load_string($body);
if (isset($xml->Code)) {
return strval($xml->Code);
}
return '';
}
/**
* Judging from the return http status code, [200-299] that is OK
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2) {
return true;
}
return false;
}
/**
* Return the original return data
*
* @return ResponseCore
*/
public function getRawResponse()
{
return $this->rawResponse;
}
/**
* Indicate whether the request is successful
*/
protected $isOk = false;
/**
* Data parsed by subclasses
*/
protected $parsedData = null;
/**
* Store the original Response returned by the auth function
*
* @var ResponseCore
*/
protected $rawResponse;
}

View File

@@ -0,0 +1,24 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
use OSS\OssClient;
/**
*
* @package OSS\Result
*/
class SymlinkResult extends Result
{
/**
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET] = rawurldecode($this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET]);
return $this->rawResponse->header;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class UploadPartResult
* @package OSS\Result
*/
class UploadPartResult extends Result
{
/**
* 结果中part的ETag
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$header = $this->rawResponse->header;
if (isset($header["etag"])) {
return $header["etag"];
}
throw new OssException("cannot get ETag");
}
}