mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
34 lines
769 B
PHP
34 lines
769 B
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
namespace OSS\Result;
|
|||
|
|
|
|||
|
|
use OSS\Core\OssException;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Class AclResult getBucketAcl接口返回结果类,封装了
|
|||
|
|
* 返回的xml数据的解析
|
|||
|
|
*
|
|||
|
|
* @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");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|