- 新增阿里云OSS SDK核心类库文件 - 新增OSS插件配置文件及钩子监听 - 新增分类图标SVG资源并优化为轻量化格式 - 替换定位接口为天地图逆地理编码接口 - 新增OSS图片缩略处理工具方法
34 行
767 B
PHP
34 行
767 B
PHP
<?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;
|
|
}
|
|
|
|
} |