coupon-admin/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php

31 lines
720 B
PHP
Raw Normal View History

2021-11-18 17:57:04 +08:00
<?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");
}
}
}