12345678910111213141516171819202122232425262728293031 |
- <?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");
- }
- }
- }
|