0
0

更新代码

This commit is contained in:
2020-08-04 10:24:44 +08:00
parent 00df028fb5
commit dfe2d107db
7848 changed files with 1002903 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace OSS\Result;
use OSS\Model\RefererConfig;
/**
* Class GetRefererResult
* @package OSS\Result
*/
class GetRefererResult extends Result
{
/**
* 解析RefererConfig数据
*
* @return RefererConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new RefererConfig();
$config->parseFromXml($content);
return $config;
}
/**
* 根据返回http状态码判断[200-299]即认为是OK, 获取bucket相关配置的接口404也认为是一种
* 有效响应
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}