- 新增阿里云OSS SDK核心类库文件 - 新增OSS插件配置文件及钩子监听 - 新增分类图标SVG资源并优化为轻量化格式 - 替换定位接口为天地图逆地理编码接口 - 新增OSS图片缩略处理工具方法
37 行
863 B
PHP
37 行
863 B
PHP
<?php
|
|
|
|
namespace OSS\Result;
|
|
|
|
use OSS\Core\OssException;
|
|
use OSS\Model\BucketInfo;
|
|
|
|
/**
|
|
* Class GetBucketResult interface returns the result class, encapsulated
|
|
* The returned xml data is parsed
|
|
*
|
|
* @package OSS\Result
|
|
*/
|
|
class GetBucketInfoResult extends Result
|
|
{
|
|
/**
|
|
* Parse data from response
|
|
*
|
|
* @return BucketInfo
|
|
* @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->Bucket)) {
|
|
$info = new BucketInfo();
|
|
$info->parseFromXmlNode($xml->Bucket);
|
|
return $info;
|
|
} else {
|
|
throw new OssException("xml format exception");
|
|
}
|
|
}
|
|
} |