提交的内容
This commit is contained in:
272
vendor/qcloud/cos-sdk-v5/src/Client.php
vendored
Executable file → Normal file
272
vendor/qcloud/cos-sdk-v5/src/Client.php
vendored
Executable file → Normal file
@ -3,6 +3,7 @@
|
||||
namespace Qcloud\Cos;
|
||||
|
||||
use GuzzleHttp\Client as HttpClient;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\HandlerStack;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
@ -13,6 +14,7 @@ use GuzzleHttp\Command\CommandInterface;
|
||||
use GuzzleHttp\Exception\ConnectException;
|
||||
use GuzzleHttp\Middleware;
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
|
||||
/**
|
||||
* @method object AbortMultipartUpload(array $args) 舍弃一个分块上传且删除已上传的分片块
|
||||
@ -51,7 +53,7 @@ use GuzzleHttp\Psr7;
|
||||
* @method object PutObject(array $args) 上传对象
|
||||
* @method object AppendObject(array $args) 追加对象
|
||||
* @method object PutObjectAcl(array $args) 设置 COS 对象的访问权限信息(Access Control List, ACL)
|
||||
* @method object PutBucketAcl(array $args) 设置存储桶(Bucket)的访问权限(Access Control List, ACL)
|
||||
* @method object PutBucketAcl(array $args) 设置存储桶(Bucket)的访问权限 (Access Control List, ACL)
|
||||
* @method object PutBucketCors(array $args) 设置存储桶(Bucket)的跨域配置信息
|
||||
* @method object PutBucketDomain(array $args) 设置存储桶(Bucket)的Domain信息
|
||||
* @method object PutBucketLifecycle(array $args) 设置存储桶(Bucket)生命周期配置
|
||||
@ -113,6 +115,7 @@ use GuzzleHttp\Psr7;
|
||||
* @method object DescribeDocProcessJob(array $args) 查询文档转码任务
|
||||
* @method object GetDescribeDocProcessJobs(array $args) 拉取符合条件的文档转码任务
|
||||
* @method object DetectImage(array $args) 图片审核
|
||||
* @method object DetectImageUrl(array $args) 图片审核
|
||||
* @method object DetectImages(array $args) 图片审核-批量
|
||||
* @method object DetectVirus(array $args) 云查毒
|
||||
* @method object GetDetectVirusResult(array $args) 查询病毒检测任务结果
|
||||
@ -189,6 +192,7 @@ use GuzzleHttp\Psr7;
|
||||
* @method object CloseOriginProtect(array $args) 关闭原图保护
|
||||
* @method object ImageDetectFace(array $args) 人脸检测
|
||||
* @method object ImageFaceEffect(array $args) 人脸特效
|
||||
* @method object ImageUrlFaceEffect(array $args) 人脸特效
|
||||
* @method object IDCardOCR(array $args) 身份证识别
|
||||
* @method object IDCardOCRByUpload(array $args) 身份证识别-上传时处理
|
||||
* @method object GetLiveCode(array $args) 获取数字验证码
|
||||
@ -213,6 +217,7 @@ use GuzzleHttp\Psr7;
|
||||
* @method object GetPicBucketList(array $args) 查询图片处理服务状态
|
||||
* @method object GetAiBucketList(array $args) 查询 AI 内容识别服务状态
|
||||
* @method object OpenAiService(array $args) 开通 AI 内容识别
|
||||
* @method object CloseAiService(array $args) 关闭AI内容识别服务
|
||||
* @method object GetAiQueueList(array $args) 搜索 AI 内容识别队列
|
||||
* @method object UpdateAiQueue(array $args) 更新 AI 内容识别队列
|
||||
* @method object CreateMediaTranscodeProTemplate(array $args) 创建音视频转码 pro 模板
|
||||
@ -233,55 +238,178 @@ use GuzzleHttp\Psr7;
|
||||
* @method object OpenImageSlim(array $args) 开通图片瘦身
|
||||
* @method object CloseImageSlim(array $args) 关闭图片瘦身
|
||||
* @method object GetImageSlim(array $args) 查询图片瘦身状态
|
||||
* @method object AutoTranslationBlockProcess(array $args) 实时文字翻译
|
||||
* @method object RecognizeLogoProcess(array $args) Logo 识别
|
||||
* @method object DetectLabelProcess(array $args) 图片标签
|
||||
* @method object AIGameRecProcess(array $args) 游戏场景识别
|
||||
* @method object AIBodyRecognitionProcess(array $args) 人体识别
|
||||
* @method object DetectPetProcess(array $args) 宠物识别
|
||||
* @method object AILicenseRecProcess(array $args) 卡证识别
|
||||
* @method object CreateMediaTargetRecTemplate(array $args) 创建视频目标检测模板
|
||||
* @method object UpdateMediaTargetRecTemplate(array $args) 更新视频目标检测模板
|
||||
* @method object CreateMediaTargetRecJobs(array $args) 提交视频目标检测任务
|
||||
* @method object CreateMediaSegmentVideoBodyJobs(array $args) 提交视频人像抠图任务
|
||||
* @method object OpenAsrService(array $args) 开通智能语音服务
|
||||
* @method object GetAsrBucketList(array $args) 查询智能语音服务
|
||||
* @method object CloseAsrService(array $args) 关闭智能语音服务
|
||||
* @method object GetAsrQueueList(array $args) 查询智能语音队列
|
||||
* @method object UpdateAsrQueue(array $args) 更新智能语音队列
|
||||
* @method object CreateMediaNoiseReductionTemplate(array $args) 创建音频降噪模板
|
||||
* @method object UpdateMediaNoiseReductionTemplate(array $args) 更新音频降噪模板
|
||||
* @method object CreateVoiceSoundHoundJobs(array $args) 提交听歌识曲任务
|
||||
* @method object CreateVoiceVocalScoreJobs(array $args) 提交音乐评分任务
|
||||
* @method object CreateDataset(array $args) 创建数据集
|
||||
* @method object CreateDatasetBinding(array $args) 绑定存储桶与数据集
|
||||
* @method object CreateFileMetaIndex(array $args) 创建元数据索引
|
||||
* @method object DatasetFaceSearch(array $args) 人脸搜索
|
||||
* @method object DatasetSimpleQuery(array $args) 简单查询
|
||||
* @method object DeleteDataset(array $args) 删除数据集
|
||||
* @method object DeleteDatasetBinding(array $args) 解绑存储桶与数据集
|
||||
* @method object DeleteFileMetaIndex(array $args) 删除元数据索引
|
||||
* @method object DescribeDataset(array $args) 查询数据集
|
||||
* @method object DescribeDatasetBinding(array $args) 查询数据集与存储桶的绑定关系
|
||||
* @method object DescribeDatasetBindings(array $args) 查询绑定关系列表
|
||||
* @method object DescribeDatasets(array $args) 列出数据集
|
||||
* @method object DescribeFileMetaIndex(array $args) 查询元数据索引
|
||||
* @method object SearchImage(array $args) 图像检索
|
||||
* @method object UpdateDataset(array $args) 更新数据集
|
||||
* @method object UpdateFileMetaIndex(array $args) 更新元数据索引
|
||||
* @method object ZipFilePreview(array $args) 压缩包预览同步请求
|
||||
* @method object GetHLSPlayKey(array $args) 获取hls播放密钥
|
||||
* @method object PostWatermarkJobs(array $args) 视频明水印-提交任务
|
||||
* @method object GeneratePlayList(array $args) 生成播放列表
|
||||
* @method object CreateWatermarkTemplate(array $args) 创建明水印模板
|
||||
* @see \Qcloud\Cos\Service::getService()
|
||||
*/
|
||||
class Client extends GuzzleClient {
|
||||
const VERSION = '2.6.5';
|
||||
const VERSION = '2.6.16';
|
||||
|
||||
public $httpClient;
|
||||
|
||||
|
||||
private $api;
|
||||
private $desc;
|
||||
private $action;
|
||||
private $operation;
|
||||
private $cosConfig;
|
||||
private $signature;
|
||||
private $rawCosConfig;
|
||||
|
||||
private $cosConfig = [
|
||||
'scheme' => 'http',
|
||||
'region' => null,
|
||||
'credentials' => [
|
||||
'appId' => null,
|
||||
'secretId' => '',
|
||||
'secretKey' => '',
|
||||
'anonymous' => false,
|
||||
'token' => null,
|
||||
],
|
||||
'timeout' => 3600,
|
||||
'connect_timeout' => 3600,
|
||||
'ip' => null,
|
||||
'port' => null,
|
||||
'endpoint' => null,
|
||||
'domain' => null,
|
||||
'proxy' => null,
|
||||
'retry' => 6,
|
||||
'userAgent' => 'cos-php-sdk-v5.' . Client::VERSION,
|
||||
'pathStyle' => false,
|
||||
'signHost' => true,
|
||||
'allow_redirects' => false,
|
||||
'allow_accelerate' => false,
|
||||
'timezone' => 'PRC',
|
||||
'locationWithScheme' => false,
|
||||
'autoChange' => false,
|
||||
'limit_flag' => false,
|
||||
'isCheckRequestPath' => true,
|
||||
];
|
||||
|
||||
public function __construct(array $cosConfig) {
|
||||
$this->rawCosConfig = $cosConfig;
|
||||
$this->cosConfig['schema'] = isset($cosConfig['schema']) ? $cosConfig['schema'] : 'http';
|
||||
$this->cosConfig['region'] = isset($cosConfig['region']) ? region_map($cosConfig['region']) : null;
|
||||
$this->cosConfig['appId'] = isset($cosConfig['credentials']['appId']) ? $cosConfig['credentials']['appId'] : null;
|
||||
$this->cosConfig['secretId'] = isset($cosConfig['credentials']['secretId']) ? trim($cosConfig['credentials']['secretId']) : '';
|
||||
$this->cosConfig['secretKey'] = isset($cosConfig['credentials']['secretKey']) ? trim($cosConfig['credentials']['secretKey']) : '';
|
||||
$this->cosConfig['anonymous'] = isset($cosConfig['credentials']['anonymous']) ? $cosConfig['credentials']['anonymous'] : false;
|
||||
$this->cosConfig['token'] = isset($cosConfig['credentials']['token']) ? trim($cosConfig['credentials']['token']) : null;
|
||||
$this->cosConfig['timeout'] = isset($cosConfig['timeout']) ? $cosConfig['timeout'] : 3600;
|
||||
$this->cosConfig['connect_timeout'] = isset($cosConfig['connect_timeout']) ? $cosConfig['connect_timeout'] : 3600;
|
||||
$this->cosConfig['ip'] = isset($cosConfig['ip']) ? $cosConfig['ip'] : null;
|
||||
$this->cosConfig['port'] = isset($cosConfig['port']) ? $cosConfig['port'] : null;
|
||||
$this->cosConfig['endpoint'] = isset($cosConfig['endpoint']) ? $cosConfig['endpoint'] : null;
|
||||
$this->cosConfig['domain'] = isset($cosConfig['domain']) ? $cosConfig['domain'] : null;
|
||||
$this->cosConfig['proxy'] = isset($cosConfig['proxy']) ? $cosConfig['proxy'] : null;
|
||||
$this->cosConfig['retry'] = isset($cosConfig['retry']) ? $cosConfig['retry'] : 1;
|
||||
$this->cosConfig['userAgent'] = isset($cosConfig['userAgent']) ? $cosConfig['userAgent'] : 'cos-php-sdk-v5.'. Client::VERSION;
|
||||
$this->cosConfig['pathStyle'] = isset($cosConfig['pathStyle']) ? $cosConfig['pathStyle'] : false;
|
||||
$this->cosConfig['signHost'] = isset($cosConfig['signHost']) ? $cosConfig['signHost'] : true;
|
||||
$this->cosConfig['allow_redirects'] = isset($cosConfig['allow_redirects']) ? $cosConfig['allow_redirects'] : false;
|
||||
$this->cosConfig['allow_accelerate'] = isset($cosConfig['allow_accelerate']) ? $cosConfig['allow_accelerate'] : false;
|
||||
$this->cosConfig['timezone'] = isset($cosConfig['timezone']) ? $cosConfig['timezone'] : 'PRC';
|
||||
$this->cosConfig['locationWithSchema'] = isset($cosConfig['locationWithSchema']) ? $cosConfig['locationWithSchema'] : false;
|
||||
|
||||
$this->cosConfig = processCosConfig(array_replace_recursive($this->cosConfig, $cosConfig));
|
||||
|
||||
global $globalCosConfig;
|
||||
$globalCosConfig = $this->cosConfig;
|
||||
|
||||
// check config
|
||||
$this->inputCheck();
|
||||
|
||||
$service = Service::getService();
|
||||
$handler = HandlerStack::create();
|
||||
$handler->push(Middleware::retry($this->retryDecide(), $this->retryDelay()));
|
||||
|
||||
$handler->push(Middleware::retry(function ($retries, $request, $response, $exception) use (&$retryCount) {
|
||||
|
||||
$this->cosConfig['limit_flag'] = false;
|
||||
|
||||
$retryCount = $retries;
|
||||
if ($retryCount >= $this->cosConfig['retry']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($response) {
|
||||
if ($response->getStatusCode() >= 300 && !$response->hasHeader('x-cos-request-id')) {
|
||||
$this->cosConfig['limit_flag'] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($response->getStatusCode() >= 500 ) {
|
||||
return true;
|
||||
}
|
||||
} elseif ($exception) {
|
||||
if ($exception instanceof Exception\ServiceResponseException) {
|
||||
if ($exception->getStatusCode() >= 500) {
|
||||
$this->cosConfig['limit_flag'] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
if ($exception instanceof ConnectException) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}, $this->retryDelay()));
|
||||
|
||||
$handler->push(Middleware::mapRequest(function (RequestInterface $request) use (&$retryCount) {
|
||||
// 获取域名
|
||||
$origin_host = $request->getUri()->getHost();
|
||||
|
||||
// 匹配 *.cos.{Region}.myqcloud.com
|
||||
$pattern1 = '/\.cos\.[a-z0-9-]+\.myqcloud\.com$/';
|
||||
|
||||
if ($retryCount > 2 && $this->cosConfig['autoChange'] && $this->cosConfig['limit_flag'] && preg_match($pattern1, $origin_host)) {
|
||||
$origin = $request->getUri();
|
||||
$host = str_replace("myqcloud.com", "tencentcos.cn", $origin->getHost());
|
||||
|
||||
// 将 URI 转换为字符串,然后替换主机名
|
||||
$originUriString = (string) $origin;
|
||||
$originUriString = str_replace("myqcloud.com", "tencentcos.cn", $originUriString);
|
||||
$originUriString = str_replace($origin->getScheme() . "://", "", $originUriString);
|
||||
|
||||
// 创建新的 URI 对象
|
||||
$uri = new Uri($originUriString);
|
||||
|
||||
// 获取路径,并从路径中移除主机名
|
||||
$path = $uri->getPath();
|
||||
$path = str_replace($host, '', $path);
|
||||
|
||||
// 使用新的路径创建新的 URI
|
||||
$uri = $uri->withPath($path);
|
||||
$uri = $uri->withHost($host)->withScheme($origin->getScheme());
|
||||
|
||||
|
||||
// 更新请求的 URI 和主机头
|
||||
$request = $request->withUri($uri)->withHeader('Host', $host);
|
||||
return $request;
|
||||
}
|
||||
return $request;
|
||||
}));
|
||||
|
||||
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
|
||||
return $request->withHeader('User-Agent', $this->cosConfig['userAgent']);
|
||||
}));
|
||||
|
||||
if ($this->cosConfig['anonymous'] != true) {
|
||||
$handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig));
|
||||
}
|
||||
@ -295,7 +423,7 @@ class Client extends GuzzleClient {
|
||||
$this->signature = new Signature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig, $this->cosConfig['token']);
|
||||
$area = $this->cosConfig['allow_accelerate'] ? 'accelerate' : $this->cosConfig['region'];
|
||||
$this->httpClient = new HttpClient([
|
||||
'base_uri' => "{$this->cosConfig['schema']}://cos.{$area}.myqcloud.com/",
|
||||
'base_uri' => "{$this->cosConfig['scheme']}://cos.{$area}.myqcloud.com/",
|
||||
'timeout' => $this->cosConfig['timeout'],
|
||||
'handler' => $handler,
|
||||
'proxy' => $this->cosConfig['proxy'],
|
||||
@ -304,10 +432,11 @@ class Client extends GuzzleClient {
|
||||
$this->desc = new Description($service);
|
||||
$this->api = (array) $this->desc->getOperations();
|
||||
parent::__construct($this->httpClient, $this->desc, [$this,
|
||||
'commandToRequestTransformer'], [$this, 'responseToResultTransformer'],
|
||||
null);
|
||||
'commandToRequestTransformer'], [$this, 'responseToResultTransformer'],
|
||||
null);
|
||||
}
|
||||
|
||||
|
||||
public function inputCheck() {
|
||||
$message = null;
|
||||
//检查Region
|
||||
@ -329,34 +458,6 @@ class Client extends GuzzleClient {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function retryDecide() {
|
||||
return function (
|
||||
$retries,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response = null,
|
||||
\Exception $exception = null
|
||||
) {
|
||||
if ($retries >= $this->cosConfig['retry']) {
|
||||
return false;
|
||||
}
|
||||
if ($response != null && $response->getStatusCode() >= 400 ) {
|
||||
return true;
|
||||
}
|
||||
if ($exception instanceof Exception\ServiceResponseException) {
|
||||
if ($exception->getStatusCode() >= 400) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($exception instanceof ConnectException) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
public function retryDelay() {
|
||||
return function ($numberOfRetries) {
|
||||
return 1000 * $numberOfRetries;
|
||||
@ -367,7 +468,7 @@ class Client extends GuzzleClient {
|
||||
{
|
||||
$this->action = $command->GetName();
|
||||
$this->operation = $this->api[$this->action];
|
||||
$transformer = new CommandToRequestTransformer($this->cosConfig, $this->operation);
|
||||
$transformer = new CommandToRequestTransformer($this->cosConfig, $this->operation);
|
||||
$seri = new Serializer($this->desc);
|
||||
$request = $seri($command);
|
||||
$request = $transformer->bucketStyleTransformer($command, $request);
|
||||
@ -384,7 +485,8 @@ class Client extends GuzzleClient {
|
||||
|
||||
public function responseToResultTransformer(ResponseInterface $response, RequestInterface $request, CommandInterface $command)
|
||||
{
|
||||
$transformer = new ResultTransformer($this->cosConfig, $this->operation);
|
||||
|
||||
$transformer = new ResultTransformer($this->cosConfig, $this->operation);
|
||||
$transformer->writeDataToLocal($command, $request, $response);
|
||||
$deseri = new Deserializer($this->desc, true);
|
||||
$result = $deseri($response, $request, $command);
|
||||
@ -395,7 +497,7 @@ class Client extends GuzzleClient {
|
||||
$result = $transformer->ciContentInfoTransformer($command, $result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function __destruct() {
|
||||
}
|
||||
|
||||
@ -417,8 +519,22 @@ class Client extends GuzzleClient {
|
||||
return $this->api;
|
||||
}
|
||||
|
||||
private function getCosConfig() {
|
||||
return $this->cosConfig;
|
||||
/**
|
||||
* Get the config of the cos client.
|
||||
*
|
||||
* @param array|string $option
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCosConfig($option = null)
|
||||
{
|
||||
return $option === null
|
||||
? $this->cosConfig
|
||||
: (isset($this->cosConfig[$option]) ? $this->cosConfig[$option] : array());
|
||||
}
|
||||
|
||||
public function setCosConfig($option, $value)
|
||||
{
|
||||
$this->cosConfig[$option] = $value;
|
||||
}
|
||||
|
||||
private function createPresignedUrl(RequestInterface $request, $expires) {
|
||||
@ -431,7 +547,6 @@ class Client extends GuzzleClient {
|
||||
return $this->createPresignedUrl($request, $expires);
|
||||
}
|
||||
|
||||
|
||||
public function getObjectUrl($bucket, $key, $expires = "+30 minutes", array $args = array()) {
|
||||
$command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
|
||||
$request = $this->commandToRequestTransformer($command);
|
||||
@ -466,11 +581,29 @@ class Client extends GuzzleClient {
|
||||
return $rt;
|
||||
}
|
||||
|
||||
public static function simplifyPath($path) {
|
||||
$names = explode("/", $path);
|
||||
$stack = array();
|
||||
foreach ($names as $name) {
|
||||
if ($name == "..") {
|
||||
if (!empty($stack)) {
|
||||
array_pop($stack);
|
||||
}
|
||||
} elseif ($name && $name != ".") {
|
||||
array_push($stack, $name);
|
||||
}
|
||||
}
|
||||
return "/" . implode("/", $stack);
|
||||
}
|
||||
|
||||
public function download($bucket, $key, $saveAs, $options = array()) {
|
||||
$options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : RangeDownload::DEFAULT_PART_SIZE;
|
||||
$contentLength = 0;
|
||||
$versionId = isset($options['VersionId']) ? $options['VersionId'] : '';
|
||||
|
||||
if ($this->cosConfig['isCheckRequestPath'] && "/" == self::simplifyPath($key)) {
|
||||
$e = new Exception\CosException('Getobject Key is illegal');
|
||||
$e->setExceptionCode('404');
|
||||
throw $e;
|
||||
}
|
||||
$rt = $this->headObject(array(
|
||||
'Bucket'=>$bucket,
|
||||
'Key'=>$key,
|
||||
@ -578,6 +711,12 @@ class Client extends GuzzleClient {
|
||||
}
|
||||
|
||||
public static function explodeKey($key) {
|
||||
global $globalCosConfig;
|
||||
if ($globalCosConfig['isCheckRequestPath'] && "/" == self::simplifyPath($key)) {
|
||||
$e = new Exception\CosException('Getobject Key is illegal');
|
||||
$e->setExceptionCode('404');
|
||||
throw $e;
|
||||
}
|
||||
// Remove a leading slash if one is found
|
||||
$split_key = explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key);
|
||||
// Remove empty element
|
||||
@ -591,7 +730,6 @@ class Client extends GuzzleClient {
|
||||
return $final_key;
|
||||
}
|
||||
|
||||
|
||||
public static function handleSignature($secretId, $secretKey, $options) {
|
||||
return function (callable $handler) use ($secretId, $secretKey, $options) {
|
||||
return new SignatureMiddleware($handler, $secretId, $secretKey, $options);
|
||||
|
||||
631
vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php
vendored
Executable file → Normal file
631
vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php
vendored
Executable file → Normal file
@ -2,12 +2,10 @@
|
||||
|
||||
namespace Qcloud\Cos;
|
||||
|
||||
use http\Exception\BadUrlException;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use GuzzleHttp\Command\CommandInterface;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
|
||||
class CommandToRequestTransformer {
|
||||
private $config;
|
||||
@ -19,25 +17,24 @@ class CommandToRequestTransformer {
|
||||
}
|
||||
|
||||
// format bucket style
|
||||
|
||||
public function bucketStyleTransformer( CommandInterface $command, RequestInterface $request ) {
|
||||
$action = $command->getName();
|
||||
if ($action == 'ListBuckets') {
|
||||
$uri = "service.cos.myqcloud.com";
|
||||
|
||||
|
||||
if ($this->config['endpoint'] != null) {
|
||||
$uri = $this->config['endpoint'];
|
||||
}
|
||||
}
|
||||
if ($this->config['domain'] != null) {
|
||||
$uri = $this->config['domain'];
|
||||
}
|
||||
}
|
||||
if ($this->config['ip'] != null) {
|
||||
$uri = $this->config['ip'];
|
||||
if ($this->config['port'] != null) {
|
||||
$uri = $this->config['ip'] . ":" . $this->config['port'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $request->withUri(new Uri($this->config['schema']."://". $uri. "/"));
|
||||
return $request->withUri(new Uri($this->config['scheme']."://". $uri. "/"));
|
||||
}
|
||||
$operation = $this->operation;
|
||||
$bucketname = $command['Bucket'];
|
||||
@ -72,10 +69,16 @@ class CommandToRequestTransformer {
|
||||
|| $action == 'BindCiService' || $action == 'GetCiService' || $action == 'UnBindCiService'
|
||||
|| $action == 'GetHotLink' || $action == 'AddHotLink'
|
||||
|| $action == 'OpenOriginProtect' || $action == 'GetOriginProtect' || $action == 'CloseOriginProtect'
|
||||
|| $action == 'OpenImageSlim' || $action == 'GetImageSlim' || $action == 'CloseImageSlim' ) {
|
||||
|| $action == 'OpenImageSlim' || $action == 'GetImageSlim' || $action == 'CloseImageSlim') {
|
||||
$domain_type = '.pic.';
|
||||
}
|
||||
|
||||
if ($domain_type == '.pic.' && ($this->config['allow_accelerate'] || $this->config['region'] == 'accelerate')) {
|
||||
$e = new Exception\CosException('CI request does not support using accelerate domain');
|
||||
$e->setExceptionCode('RegionUnsupport');
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$origin_host = $this->config['allow_accelerate'] ?
|
||||
$bucketname . $domain_type . 'accelerate' . '.' . $this->config['endpoint'] :
|
||||
$bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint'];
|
||||
@ -92,7 +95,7 @@ class CommandToRequestTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
$path = $this->config['schema'].'://'. $host . $uri;
|
||||
$path = $this->config['scheme'].'://'. $host . $uri;
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
if ( $uri->getQuery() != $query && $uri->getQuery() != '' ) {
|
||||
@ -105,9 +108,7 @@ class CommandToRequestTransformer {
|
||||
}
|
||||
|
||||
// format upload body
|
||||
|
||||
public function uploadBodyTransformer( CommandInterface $command, $request, $bodyParameter = 'Body', $sourceParameter = 'SourceFile' ) {
|
||||
|
||||
$operation = $this->operation;
|
||||
if ( !isset( $operation['parameters']['Body'] ) ) {
|
||||
return $request;
|
||||
@ -126,285 +127,351 @@ class CommandToRequestTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
// update md5
|
||||
|
||||
public function md5Transformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $operation['data']['contentMd5'] ) ) {
|
||||
// update md5
|
||||
public function md5Transformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $operation['data']['contentMd5'] ) ) {
|
||||
$request = $this->addMd5( $request );
|
||||
}
|
||||
if ( isset( $operation['parameters']['ContentMD5'] ) &&
|
||||
isset( $command['ContentMD5'] ) ) {
|
||||
$value = $command['ContentMD5'];
|
||||
if ( $value != false ) {
|
||||
$request = $this->addMd5( $request );
|
||||
}
|
||||
if ( isset( $operation['parameters']['ContentMD5'] ) &&
|
||||
isset( $command['ContentMD5'] ) ) {
|
||||
$value = $command['ContentMD5'];
|
||||
if ( $value != false ) {
|
||||
$request = $this->addMd5( $request );
|
||||
}
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
// add Query string
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function queryStringTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Params'] ) ) {
|
||||
$params = $command['Params'];
|
||||
foreach ( $params as $key => $value ) {
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
$uri = $uri->withQuery($query. "&" . urlencode($key) . "=" . $value );
|
||||
$request = $request->withUri( $uri );
|
||||
}
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
// add Header string
|
||||
|
||||
public function headerTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Headers'] ) ) {
|
||||
$headers = $command['Headers'];
|
||||
foreach ( $headers as $key => $value ) {
|
||||
$request = $request->withHeader( $key, $value);
|
||||
}
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
// add meta
|
||||
|
||||
public function metadataTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Metadata'] ) ) {
|
||||
$meta = $command['Metadata'];
|
||||
foreach ( $meta as $key => $value ) {
|
||||
$request = $request->withHeader( 'x-cos-meta-' . $key, $value );
|
||||
}
|
||||
}
|
||||
$request = headersMap( $command, $request );
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
// count md5
|
||||
|
||||
private function addMd5( $request ) {
|
||||
$body = $request->getBody();
|
||||
if ( $body && $body->getSize() > 0 ) {
|
||||
$md5 = base64_encode( md5( $body, true ) );
|
||||
return $request->withHeader( 'Content-MD5', $md5 );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
// inventoryId
|
||||
|
||||
public function specialParamTransformer( CommandInterface $command, $request ) {
|
||||
$action = $command->getName();
|
||||
if ( $action == 'PutBucketInventory' ) {
|
||||
$id = $command['Id'];
|
||||
// add Query string
|
||||
public function queryStringTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Params'] ) ) {
|
||||
$params = $command['Params'];
|
||||
foreach ( $params as $key => $value ) {
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
$uri = $uri->withQuery( $query . '&Id='.$id );
|
||||
return $request->withUri( $uri );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function ciParamTransformer( CommandInterface $command, $request ) {
|
||||
$action = $command->getName();
|
||||
if ( $action == 'GetObject' ) {
|
||||
if(str_contains($uri = $request->getUri(), '%21') ) {
|
||||
$uri = new Uri( str_replace('%21', '!', $uri) );
|
||||
$request = $request->withUri( $uri );
|
||||
}
|
||||
if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
if($query){
|
||||
$query .= "&" . urlencode($command['ImageHandleParam']);
|
||||
}else{
|
||||
$query .= urlencode($command['ImageHandleParam']);
|
||||
}
|
||||
$uri = $uri->withQuery($query);
|
||||
$request = $request->withUri( $uri );
|
||||
}
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function cosDomain2CiTransformer(CommandInterface $command, $request) {
|
||||
$action = $command->getName();
|
||||
if(key_exists($action, array(
|
||||
'DescribeMediaBuckets' => 1,
|
||||
'DescribeDocProcessBuckets' =>1,
|
||||
'GetPicBucketList' =>1,
|
||||
'GetAiBucketList' =>1,
|
||||
))) {
|
||||
$origin_host = "ci.{$this->config['region']}.myqcloud.com";
|
||||
$host = $origin_host;
|
||||
if ($this->config['ip'] != null) {
|
||||
$host = $this->config['ip'];
|
||||
if ($this->config['port'] != null) {
|
||||
$host = $this->config['ip'] . ":" . $this->config['port'];
|
||||
}
|
||||
}
|
||||
|
||||
$path = $this->config['schema'].'://'. $host . $request->getUri()->getPath();
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
$uri = $uri->withQuery( $query );
|
||||
$uri = $uri->withQuery($query. "&" . urlencode($key) . "=" . $value );
|
||||
$request = $request->withUri( $uri );
|
||||
$request = $request->withHeader( 'Host', $origin_host );
|
||||
return $request;
|
||||
}
|
||||
$ciActions = array(
|
||||
'DetectText' => 1,
|
||||
'CreateMediaTranscodeJobs' => 1,
|
||||
'CreateMediaJobs' => 1,
|
||||
'DescribeMediaJob' => 1,
|
||||
'DescribeMediaJobs' => 1,
|
||||
'CreateMediaSnapshotJobs' => 1,
|
||||
'CreateMediaConcatJobs' => 1,
|
||||
'DetectAudio' => 1,
|
||||
'GetDetectAudioResult' => 1,
|
||||
'GetDetectTextResult' => 1,
|
||||
'DetectVideo' => 1,
|
||||
'GetDetectVideoResult' => 1,
|
||||
'DetectDocument' => 1,
|
||||
'GetDetectDocumentResult' => 1,
|
||||
'CreateDocProcessJobs' => 1,
|
||||
'DescribeDocProcessQueues' => 1,
|
||||
'DescribeDocProcessJob' => 1,
|
||||
'GetDescribeDocProcessJobs' => 1,
|
||||
'DetectImages' => 1,
|
||||
'GetDetectImageResult' => 1,
|
||||
'DetectVirus' => 1,
|
||||
'GetDetectVirusResult' => 1,
|
||||
'CreateMediaVoiceSeparateJobs' => 1,
|
||||
'DescribeMediaVoiceSeparateJob' => 1,
|
||||
'DetectWebpage' => 1,
|
||||
'GetDetectWebpageResult' => 1,
|
||||
'DescribeMediaQueues' => 1,
|
||||
'UpdateMediaQueue' => 1,
|
||||
'CreateMediaSmartCoverJobs' => 1,
|
||||
'CreateMediaVideoProcessJobs' => 1,
|
||||
'CreateMediaVideoMontageJobs' => 1,
|
||||
'CreateMediaAnimationJobs' => 1,
|
||||
'CreateMediaPicProcessJobs' => 1,
|
||||
'CreateMediaSegmentJobs' => 1,
|
||||
'CreateMediaVideoTagJobs' => 1,
|
||||
'CreateMediaSuperResolutionJobs' => 1,
|
||||
'CreateMediaSDRtoHDRJobs' => 1,
|
||||
'CreateMediaDigitalWatermarkJobs' => 1,
|
||||
'CreateMediaExtractDigitalWatermarkJobs' => 1,
|
||||
'DetectLiveVideo' => 1,
|
||||
'CancelLiveVideoAuditing' => 1,
|
||||
'TriggerWorkflow' => 1,
|
||||
'GetWorkflowInstances' => 1,
|
||||
'GetWorkflowInstance' => 1,
|
||||
'CreateMediaSnapshotTemplate' => 1,
|
||||
'UpdateMediaSnapshotTemplate' => 1,
|
||||
'CreateMediaTranscodeTemplate' => 1,
|
||||
'UpdateMediaTranscodeTemplate' => 1,
|
||||
'CreateMediaHighSpeedHdTemplate' => 1,
|
||||
'UpdateMediaHighSpeedHdTemplate' => 1,
|
||||
'CreateMediaAnimationTemplate' => 1,
|
||||
'UpdateMediaAnimationTemplate' => 1,
|
||||
'CreateMediaConcatTemplate' => 1,
|
||||
'UpdateMediaConcatTemplate' => 1,
|
||||
'CreateMediaVideoProcessTemplate' => 1,
|
||||
'UpdateMediaVideoProcessTemplate' => 1,
|
||||
'CreateMediaVideoMontageTemplate' => 1,
|
||||
'UpdateMediaVideoMontageTemplate' => 1,
|
||||
'CreateMediaVoiceSeparateTemplate' => 1,
|
||||
'UpdateMediaVoiceSeparateTemplate' => 1,
|
||||
'CreateMediaSuperResolutionTemplate' => 1,
|
||||
'UpdateMediaSuperResolutionTemplate' => 1,
|
||||
'CreateMediaPicProcessTemplate' => 1,
|
||||
'UpdateMediaPicProcessTemplate' => 1,
|
||||
'CreateMediaWatermarkTemplate' => 1,
|
||||
'UpdateMediaWatermarkTemplate' => 1,
|
||||
'DescribeMediaTemplates' => 1,
|
||||
'DescribeWorkflow' => 1,
|
||||
'DeleteWorkflow' => 1,
|
||||
'CreateInventoryTriggerJob' => 1,
|
||||
'DescribeInventoryTriggerJobs' => 1,
|
||||
'DescribeInventoryTriggerJob' => 1,
|
||||
'CancelInventoryTriggerJob' => 1,
|
||||
'CreateMediaNoiseReductionJobs' => 1,
|
||||
'ImageSearchOpen' => 1,
|
||||
'UpdateDocProcessQueue' => 1,
|
||||
'CreateMediaQualityEstimateJobs' => 1,
|
||||
'CreateMediaStreamExtractJobs' => 1,
|
||||
'OpenFileProcessService' => 1,
|
||||
'GetFileProcessQueueList' => 1,
|
||||
'UpdateFileProcessQueue' => 1,
|
||||
'CreateFileHashCodeJobs' => 1,
|
||||
'GetFileHashCodeResult' => 1,
|
||||
'CreateFileUncompressJobs' => 1,
|
||||
'GetFileUncompressResult' => 1,
|
||||
'CreateFileCompressJobs' => 1,
|
||||
'GetFileCompressResult' => 1,
|
||||
'CreateM3U8PlayListJobs' => 1,
|
||||
'GetPicQueueList' => 1,
|
||||
'UpdatePicQueue' => 1,
|
||||
'OpenAiService' => 1,
|
||||
'GetAiQueueList' => 1,
|
||||
'UpdateAiQueue' => 1,
|
||||
'CreateMediaTranscodeProTemplate' => 1,
|
||||
'UpdateMediaTranscodeProTemplate' => 1,
|
||||
'CreateVoiceTtsTemplate' => 1,
|
||||
'UpdateVoiceTtsTemplate' => 1,
|
||||
'CreateMediaSmartCoverTemplate' => 1,
|
||||
'UpdateMediaSmartCoverTemplate' => 1,
|
||||
'CreateVoiceSpeechRecognitionTemplate' => 1,
|
||||
'UpdateVoiceSpeechRecognitionTemplate' => 1,
|
||||
'CreateVoiceTtsJobs' => 1,
|
||||
'CreateAiTranslationJobs' => 1,
|
||||
'CreateVoiceSpeechRecognitionJobs' => 1,
|
||||
'CreateAiWordsGeneralizeJobs' => 1,
|
||||
'CreateMediaVideoEnhanceJobs' => 1,
|
||||
'CreateMediaVideoEnhanceTemplate' => 1,
|
||||
'UpdateMediaVideoEnhanceTemplate' => 1,
|
||||
);
|
||||
if (key_exists($action, $ciActions)) {
|
||||
// 万象接口需要https,http方式报错
|
||||
if($this->config['schema'] !== 'https') {
|
||||
$e = new Exception\CosException('CI request schema must be "https", instead of "http"');
|
||||
$e->setExceptionCode('Invalid Argument');
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$bucketname = $command['Bucket'];
|
||||
$appId = $this->config['appId'];
|
||||
if ( $appId != null && endWith( $bucketname, '-'.$appId ) == false ) {
|
||||
$bucketname = $bucketname.'-'.$appId;
|
||||
}
|
||||
$command['Bucket'] = $bucketname;
|
||||
$domain_type = '.ci.';
|
||||
$origin_host = $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint'];
|
||||
$host = $origin_host;
|
||||
if ( $this->config['ip'] != null ) {
|
||||
$host = $this->config['ip'];
|
||||
if ( $this->config['port'] != null ) {
|
||||
$host = $this->config['ip'] . ':' . $this->config['port'];
|
||||
}
|
||||
}
|
||||
$path = $this->config['schema'].'://'. $host . $request->getUri()->getPath();
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
$uri = $uri->withQuery( $query );
|
||||
$request = $request->withUri( $uri );
|
||||
$request = $request->withHeader( 'Host', $origin_host );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
// add Header string
|
||||
public function headerTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Headers'] ) ) {
|
||||
$headers = $command['Headers'];
|
||||
foreach ( $headers as $key => $value ) {
|
||||
$request = $request->withHeader( $key, $value);
|
||||
}
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
// add meta
|
||||
|
||||
public function metadataTransformer( CommandInterface $command, $request ) {
|
||||
$operation = $this->operation;
|
||||
if ( isset( $command['Metadata'] ) ) {
|
||||
$meta = $command['Metadata'];
|
||||
foreach ( $meta as $key => $value ) {
|
||||
$request = $request->withHeader( 'x-cos-meta-' . $key, $value );
|
||||
}
|
||||
}
|
||||
$request = headersMap( $command, $request );
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
// count md5
|
||||
private function addMd5( $request ) {
|
||||
$body = $request->getBody();
|
||||
if ( $body && $body->getSize() > 0 ) {
|
||||
$md5 = base64_encode( md5( $body, true ) );
|
||||
return $request->withHeader( 'Content-MD5', $md5 );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
// inventoryId
|
||||
public function specialParamTransformer( CommandInterface $command, $request ) {
|
||||
$action = $command->getName();
|
||||
if ( $action == 'PutBucketInventory' ) {
|
||||
$id = $command['Id'];
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
$uri = $uri->withQuery( $query . '&Id='.$id );
|
||||
return $request->withUri( $uri );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function ciParamTransformer( CommandInterface $command, $request ) {
|
||||
$action = $command->getName();
|
||||
if ( $action == 'GetObject' ) {
|
||||
if(str_contains($uri = $request->getUri(), '%21') ) {
|
||||
$uri = new Uri( str_replace('%21', '!', $uri) );
|
||||
$request = $request->withUri( $uri );
|
||||
}
|
||||
if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){
|
||||
$uri = $request->getUri();
|
||||
$query = $uri->getQuery();
|
||||
if($query){
|
||||
$query .= "&" . urlencode($command['ImageHandleParam']);
|
||||
}else{
|
||||
$query .= urlencode($command['ImageHandleParam']);
|
||||
}
|
||||
$uri = $uri->withQuery($query);
|
||||
$request = $request->withUri( $uri );
|
||||
}
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function cosDomain2CiTransformer(CommandInterface $command, $request) {
|
||||
$action = $command->getName();
|
||||
if(key_exists($action, array(
|
||||
'DescribeMediaBuckets' => 1,
|
||||
'DescribeDocProcessBuckets' => 1,
|
||||
'GetPicBucketList' => 1,
|
||||
'GetAiBucketList' => 1,
|
||||
'GetAsrBucketList' => 1,
|
||||
))) {
|
||||
$origin_host = "ci.{$this->config['region']}.myqcloud.com";
|
||||
$host = $origin_host;
|
||||
if ($this->config['ip'] != null) {
|
||||
$host = $this->config['ip'];
|
||||
if ($this->config['port'] != null) {
|
||||
$host = $this->config['ip'] . ':' . $this->config['port'];
|
||||
}
|
||||
}
|
||||
|
||||
// 万象接口需要https,http方式报错
|
||||
if ($this->config['scheme'] !== 'https') {
|
||||
$e = new Exception\CosException('CI request scheme must be "https", instead of "http"');
|
||||
$e->setExceptionCode('Invalid Argument');
|
||||
throw $e;
|
||||
}
|
||||
$path = $this->config['scheme'].'://'. $host . $request->getUri()->getPath();
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
$uri = $uri->withQuery( $query );
|
||||
$request = $request->withUri( $uri );
|
||||
$request = $request->withHeader( 'Host', $origin_host );
|
||||
return $request;
|
||||
}
|
||||
if(key_exists($action, array(
|
||||
'CreateDataset' => 1,
|
||||
'DeleteDataset' => 1,
|
||||
'DescribeDataset' => 1,
|
||||
'DescribeDatasets' => 1,
|
||||
'UpdateDataset' => 1,
|
||||
'CreateDatasetBinding' => 1,
|
||||
'DeleteDatasetBinding' => 1,
|
||||
'DescribeDatasetBinding' => 1,
|
||||
'DescribeDatasetBindings' => 1,
|
||||
'CreateFileMetaIndex' => 1,
|
||||
'DeleteFileMetaIndex' => 1,
|
||||
'DescribeFileMetaIndex' => 1,
|
||||
'UpdateFileMetaIndex' => 1,
|
||||
'SearchImage' => 1,
|
||||
'DatasetFaceSearch' => 1,
|
||||
'DatasetSimpleQuery' => 1,
|
||||
))) {
|
||||
if (!$command->hasParam( 'AppId' )){
|
||||
$e = new Exception\CosException('params must include "Appid"');
|
||||
$e->setExceptionCode('Invalid Argument');
|
||||
throw $e;
|
||||
}
|
||||
$appid=$command['AppId'];
|
||||
$origin_host = "$appid.ci.{$this->config['region']}.myqcloud.com";
|
||||
$host = $origin_host;
|
||||
if ($this->config['ip'] != null) {
|
||||
$host = $this->config['ip'];
|
||||
if ($this->config['port'] != null) {
|
||||
$host = $this->config['ip'] . ':' . $this->config['port'];
|
||||
}
|
||||
}
|
||||
|
||||
// 万象接口需要https,http方式报错
|
||||
if ($this->config['scheme'] !== 'https') {
|
||||
$e = new Exception\CosException('CI request scheme must be "https", instead of "http"');
|
||||
$e->setExceptionCode('Invalid Argument');
|
||||
throw $e;
|
||||
}
|
||||
$path = $this->config['scheme'].'://'. $host . $request->getUri()->getPath();
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
$uri = $uri->withQuery( $query );
|
||||
$request = $request->withUri( $uri );
|
||||
$request = $request->withHeader( 'Host', $origin_host );
|
||||
return $request;
|
||||
}
|
||||
|
||||
$ciActions = array(
|
||||
'DetectText' => 1,
|
||||
'CreateMediaTranscodeJobs' => 1,
|
||||
'CreateMediaJobs' => 1,
|
||||
'DescribeMediaJob' => 1,
|
||||
'DescribeMediaJobs' => 1,
|
||||
'CreateMediaSnapshotJobs' => 1,
|
||||
'CreateMediaConcatJobs' => 1,
|
||||
'DetectAudio' => 1,
|
||||
'GetDetectAudioResult' => 1,
|
||||
'GetDetectTextResult' => 1,
|
||||
'DetectVideo' => 1,
|
||||
'GetDetectVideoResult' => 1,
|
||||
'DetectDocument' => 1,
|
||||
'GetDetectDocumentResult' => 1,
|
||||
'CreateDocProcessJobs' => 1,
|
||||
'DescribeDocProcessQueues' => 1,
|
||||
'DescribeDocProcessJob' => 1,
|
||||
'GetDescribeDocProcessJobs' => 1,
|
||||
'DetectImages' => 1,
|
||||
'GetDetectImageResult' => 1,
|
||||
'DetectVirus' => 1,
|
||||
'GetDetectVirusResult' => 1,
|
||||
'CreateMediaVoiceSeparateJobs' => 1,
|
||||
'DescribeMediaVoiceSeparateJob' => 1,
|
||||
'DetectWebpage' => 1,
|
||||
'GetDetectWebpageResult' => 1,
|
||||
'DescribeMediaQueues' => 1,
|
||||
'UpdateMediaQueue' => 1,
|
||||
'CreateMediaSmartCoverJobs' => 1,
|
||||
'CreateMediaVideoProcessJobs' => 1,
|
||||
'CreateMediaVideoMontageJobs' => 1,
|
||||
'CreateMediaAnimationJobs' => 1,
|
||||
'CreateMediaPicProcessJobs' => 1,
|
||||
'CreateMediaSegmentJobs' => 1,
|
||||
'CreateMediaVideoTagJobs' => 1,
|
||||
'CreateMediaSuperResolutionJobs' => 1,
|
||||
'CreateMediaSDRtoHDRJobs' => 1,
|
||||
'CreateMediaDigitalWatermarkJobs' => 1,
|
||||
'CreateMediaExtractDigitalWatermarkJobs' => 1,
|
||||
'DetectLiveVideo' => 1,
|
||||
'CancelLiveVideoAuditing' => 1,
|
||||
'TriggerWorkflow' => 1,
|
||||
'GetWorkflowInstances' => 1,
|
||||
'GetWorkflowInstance' => 1,
|
||||
'CreateMediaSnapshotTemplate' => 1,
|
||||
'UpdateMediaSnapshotTemplate' => 1,
|
||||
'CreateMediaTranscodeTemplate' => 1,
|
||||
'UpdateMediaTranscodeTemplate' => 1,
|
||||
'CreateMediaHighSpeedHdTemplate' => 1,
|
||||
'UpdateMediaHighSpeedHdTemplate' => 1,
|
||||
'CreateMediaAnimationTemplate' => 1,
|
||||
'UpdateMediaAnimationTemplate' => 1,
|
||||
'CreateMediaConcatTemplate' => 1,
|
||||
'UpdateMediaConcatTemplate' => 1,
|
||||
'CreateMediaVideoProcessTemplate' => 1,
|
||||
'UpdateMediaVideoProcessTemplate' => 1,
|
||||
'CreateMediaVideoMontageTemplate' => 1,
|
||||
'UpdateMediaVideoMontageTemplate' => 1,
|
||||
'CreateMediaVoiceSeparateTemplate' => 1,
|
||||
'UpdateMediaVoiceSeparateTemplate' => 1,
|
||||
'CreateMediaSuperResolutionTemplate' => 1,
|
||||
'UpdateMediaSuperResolutionTemplate' => 1,
|
||||
'CreateMediaPicProcessTemplate' => 1,
|
||||
'UpdateMediaPicProcessTemplate' => 1,
|
||||
'CreateMediaWatermarkTemplate' => 1,
|
||||
'UpdateMediaWatermarkTemplate' => 1,
|
||||
'DescribeMediaTemplates' => 1,
|
||||
'DescribeWorkflow' => 1,
|
||||
'DeleteWorkflow' => 1,
|
||||
'CreateInventoryTriggerJob' => 1,
|
||||
'DescribeInventoryTriggerJobs' => 1,
|
||||
'DescribeInventoryTriggerJob' => 1,
|
||||
'CancelInventoryTriggerJob' => 1,
|
||||
'CreateMediaNoiseReductionJobs' => 1,
|
||||
'ImageSearchOpen' => 1,
|
||||
'UpdateDocProcessQueue' => 1,
|
||||
'CreateMediaQualityEstimateJobs' => 1,
|
||||
'CreateMediaStreamExtractJobs' => 1,
|
||||
'OpenFileProcessService' => 1,
|
||||
'GetFileProcessQueueList' => 1,
|
||||
'UpdateFileProcessQueue' => 1,
|
||||
'CreateFileHashCodeJobs' => 1,
|
||||
'GetFileHashCodeResult' => 1,
|
||||
'CreateFileUncompressJobs' => 1,
|
||||
'GetFileUncompressResult' => 1,
|
||||
'CreateFileCompressJobs' => 1,
|
||||
'GetFileCompressResult' => 1,
|
||||
'CreateM3U8PlayListJobs' => 1,
|
||||
'GetPicQueueList' => 1,
|
||||
'UpdatePicQueue' => 1,
|
||||
'OpenAiService' => 1,
|
||||
'CloseAiService' => 1,
|
||||
'GetAiQueueList' => 1,
|
||||
'UpdateAiQueue' => 1,
|
||||
'CreateMediaTranscodeProTemplate' => 1,
|
||||
'UpdateMediaTranscodeProTemplate' => 1,
|
||||
'CreateVoiceTtsTemplate' => 1,
|
||||
'UpdateVoiceTtsTemplate' => 1,
|
||||
'CreateMediaSmartCoverTemplate' => 1,
|
||||
'UpdateMediaSmartCoverTemplate' => 1,
|
||||
'CreateVoiceSpeechRecognitionTemplate' => 1,
|
||||
'UpdateVoiceSpeechRecognitionTemplate' => 1,
|
||||
'CreateVoiceTtsJobs' => 1,
|
||||
'CreateAiTranslationJobs' => 1,
|
||||
'CreateVoiceSpeechRecognitionJobs' => 1,
|
||||
'CreateAiWordsGeneralizeJobs' => 1,
|
||||
'CreateMediaVideoEnhanceJobs' => 1,
|
||||
'CreateMediaVideoEnhanceTemplate' => 1,
|
||||
'UpdateMediaVideoEnhanceTemplate' => 1,
|
||||
'CreateMediaTargetRecTemplate' => 1,
|
||||
'UpdateMediaTargetRecTemplate' => 1,
|
||||
'CreateMediaTargetRecJobs' => 1,
|
||||
'CreateMediaSegmentVideoBodyJobs' => 1,
|
||||
'OpenAsrService' => 1,
|
||||
'CloseAsrService' => 1,
|
||||
'GetAsrQueueList' => 1,
|
||||
'UpdateAsrQueue' => 1,
|
||||
'CreateMediaNoiseReductionTemplate' => 1,
|
||||
'UpdateMediaNoiseReductionTemplate' => 1,
|
||||
'CreateVoiceSoundHoundJobs' => 1,
|
||||
'CreateVoiceVocalScoreJobs' => 1,
|
||||
'GetHLSPlayKey' => 1,
|
||||
'PostWatermarkJobs' => 1,
|
||||
'GeneratePlayList' => 1,
|
||||
'CreateWatermarkTemplate' => 1,
|
||||
);
|
||||
if (key_exists($action, $ciActions)) {
|
||||
// 万象接口需要https,http方式报错
|
||||
if ($this->config['scheme'] !== 'https') {
|
||||
$e = new Exception\CosException('CI request scheme must be "https", instead of "http"');
|
||||
$e->setExceptionCode('Invalid Argument');
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$bucketname = $command['Bucket'];
|
||||
$appId = $this->config['appId'];
|
||||
if ( $appId != null && endWith( $bucketname, '-'.$appId ) == false ) {
|
||||
$bucketname = $bucketname.'-'.$appId;
|
||||
}
|
||||
$command['Bucket'] = $bucketname;
|
||||
$domain_type = '.ci.';
|
||||
$origin_host = $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint'];
|
||||
$host = $origin_host;
|
||||
if ( $this->config['ip'] != null ) {
|
||||
$host = $this->config['ip'];
|
||||
if ( $this->config['port'] != null ) {
|
||||
$host = $this->config['ip'] . ':' . $this->config['port'];
|
||||
}
|
||||
}
|
||||
$path = $this->config['scheme'].'://'. $host . $request->getUri()->getPath();
|
||||
$uri = new Uri( $path );
|
||||
$query = $request->getUri()->getQuery();
|
||||
$uri = $uri->withQuery( $query );
|
||||
$request = $request->withUri( $uri );
|
||||
$request = $request->withHeader( 'Host', $origin_host );
|
||||
}
|
||||
return $request;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
}
|
||||
}
|
||||
|
||||
23
vendor/qcloud/cos-sdk-v5/src/Common.php
vendored
Executable file → Normal file
23
vendor/qcloud/cos-sdk-v5/src/Common.php
vendored
Executable file → Normal file
@ -24,6 +24,29 @@ function region_map($region)
|
||||
return $region;
|
||||
}
|
||||
|
||||
function processCosConfig($config)
|
||||
{
|
||||
$config['region'] = !empty($config['region']) ? region_map($config['region']) : $config['region'];
|
||||
$config['secretId'] = trim($config['credentials']['secretId']);
|
||||
$config['secretKey'] = trim($config['credentials']['secretKey']);
|
||||
$config['token'] = !empty($config['credentials']['token']) ? trim($config['credentials']['token']) : $config['credentials']['token'];
|
||||
$config['appId'] = $config['credentials']['appId'];
|
||||
$config['anonymous'] = $config['credentials']['anonymous'];
|
||||
unset($config['credentials']);
|
||||
|
||||
if (isset($config['schema'])) {
|
||||
$config['scheme'] = $config['schema'];
|
||||
unset($config['schema']);
|
||||
}
|
||||
|
||||
if (isset($config['locationWithSchema'])) {
|
||||
$config['locationWithScheme'] = $config['locationWithSchema'];
|
||||
unset($config['locationWithSchema']);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
function encodeKey($key)
|
||||
{
|
||||
return str_replace('%2F', '/', rawurlencode($key));
|
||||
|
||||
5
vendor/qcloud/cos-sdk-v5/src/Copy.php
vendored
Executable file → Normal file
5
vendor/qcloud/cos-sdk-v5/src/Copy.php
vendored
Executable file → Normal file
@ -18,6 +18,8 @@ class Copy {
|
||||
private $size;
|
||||
private $commandList = [];
|
||||
private $requestList = [];
|
||||
private $concurrency;
|
||||
private $retry;
|
||||
|
||||
public function __construct($client, $source, $options = array()) {
|
||||
$minPartSize = $options['PartSize'];
|
||||
@ -108,7 +110,7 @@ class Copy {
|
||||
$this->parts[$index] = $part;
|
||||
} catch(\Exception $e) {
|
||||
if ($i == $retry) {
|
||||
throw($e);
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,5 +138,4 @@ class Copy {
|
||||
$result = $this->client->createMultipartUpload($this->options);
|
||||
return $result['UploadId'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
4115
vendor/qcloud/cos-sdk-v5/src/Descriptions.php
vendored
Executable file → Normal file
4115
vendor/qcloud/cos-sdk-v5/src/Descriptions.php
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
0
vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Exception/ServiceResponseException.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Exception/ServiceResponseException.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php
vendored
Executable file → Normal file
2
vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php
vendored
Executable file → Normal file
@ -6,7 +6,6 @@ use Qcloud\Cos\Exception\ServiceResponseException;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
||||
class ExceptionMiddleware {
|
||||
private $nextHandler;
|
||||
@ -43,7 +42,6 @@ class ExceptionMiddleware {
|
||||
return $response;
|
||||
}
|
||||
|
||||
//throw RequestException::create($request, $response);
|
||||
$parts = $this->parser->parse($request, $response);
|
||||
|
||||
$className = 'Qcloud\\Cos\\Exception\\' . $parts['code'];
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php
vendored
Executable file → Normal file
13
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php
vendored
Executable file → Normal file
13
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php
vendored
Executable file → Normal file
@ -8,6 +8,7 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
private $image;
|
||||
private $text;
|
||||
private $level;
|
||||
private $version;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
@ -16,6 +17,7 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
$this->image = "";
|
||||
$this->text = "";
|
||||
$this->level = "";
|
||||
$this->version = "";
|
||||
|
||||
}
|
||||
|
||||
@ -38,6 +40,9 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
public function setLevel($value) {
|
||||
$this->level = "/level/" . $value;
|
||||
}
|
||||
public function setVersion($value) {
|
||||
$this->version = "/version/" . $value;
|
||||
}
|
||||
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
@ -55,6 +60,10 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
return $this->level;
|
||||
}
|
||||
|
||||
public function getVersion() {
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
|
||||
public function queryString() {
|
||||
$head = "watermark/$this->markType";
|
||||
@ -71,6 +80,9 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
if($this->level){
|
||||
$res .= $this->level;
|
||||
}
|
||||
if($this->version){
|
||||
$res .= $this->version;
|
||||
}
|
||||
if($res){
|
||||
$res = $head . $res;
|
||||
}
|
||||
@ -83,5 +95,6 @@ class BlindWatermarkTemplate extends ImageTemplate {
|
||||
$this->image = "";
|
||||
$this->text = "";
|
||||
$this->level = "";
|
||||
$this->version = "";
|
||||
}
|
||||
}
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIProcessTransformation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php
vendored
Executable file → Normal file
60
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php
vendored
Executable file → Normal file
60
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php
vendored
Executable file → Normal file
@ -4,34 +4,68 @@ namespace Qcloud\Cos\ImageParamTemplate;
|
||||
|
||||
class ImageQrcodeTemplate extends ImageTemplate
|
||||
{
|
||||
private $mode;
|
||||
private $cover;
|
||||
private $barType;
|
||||
private $segment;
|
||||
private $size;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->mode = "";
|
||||
$this->cover = "";
|
||||
$this->barType = "";
|
||||
$this->segment = "";
|
||||
$this->size = "";
|
||||
}
|
||||
|
||||
public function setMode($mode) {
|
||||
$this->mode = "/cover/" . $mode;
|
||||
public function setCover($cover) {
|
||||
$this->cover = "/cover/" . $cover;
|
||||
}
|
||||
public function getCover() {
|
||||
return $this->cover;
|
||||
}
|
||||
|
||||
public function getMode() {
|
||||
return $this->mode;
|
||||
public function setBarType($barType) {
|
||||
$this->barType = "/bar-type/" . $barType;
|
||||
}
|
||||
public function getBarType() {
|
||||
return $this->barType;
|
||||
}
|
||||
|
||||
public function setSegment($segment) {
|
||||
$this->segment = "/segmente/" . $segment;
|
||||
}
|
||||
public function getSegment() {
|
||||
return $this->segment;
|
||||
}
|
||||
|
||||
public function setSize($size) {
|
||||
$this->size = "/size/" . $size;
|
||||
}
|
||||
public function getSize() {
|
||||
return $this->size;
|
||||
}
|
||||
|
||||
public function queryString() {
|
||||
$head = "QRcode";
|
||||
$res = "";
|
||||
if($this->mode) {
|
||||
$res .= $this->mode;
|
||||
$res = "QRcode";
|
||||
if($this->cover) {
|
||||
$res .= $this->cover;
|
||||
}
|
||||
if($res) {
|
||||
$res = $head . $res;
|
||||
if($this->barType) {
|
||||
$res .= $this->barType;
|
||||
}
|
||||
if($this->segment) {
|
||||
$res .= $this->segment;
|
||||
}
|
||||
if($this->size) {
|
||||
$res .= $this->size;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function resetRule() {
|
||||
$this->mode = "";
|
||||
$this->cover = "";
|
||||
$this->barType = "";
|
||||
$this->segment = "";
|
||||
$this->size = "";
|
||||
}
|
||||
}
|
||||
|
||||
8
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageSlimTemplate.php
vendored
Normal file
8
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageSlimTemplate.php
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Qcloud\Cos\ImageParamTemplate;
|
||||
class ImageSlimTemplate extends ImageTemplate {
|
||||
public function queryString() {
|
||||
return "imageSlim";
|
||||
}
|
||||
}
|
||||
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageViewTemplate.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageViewTemplate.php
vendored
Executable file → Normal file
36
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php
vendored
Executable file → Normal file
36
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php
vendored
Executable file → Normal file
@ -6,6 +6,7 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
{
|
||||
|
||||
private $image;
|
||||
private $imageKey;
|
||||
private $gravity;
|
||||
private $dx;
|
||||
private $dy;
|
||||
@ -14,11 +15,13 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
private $spcent;
|
||||
private $dissolve;
|
||||
private $batch;
|
||||
private $spacing;
|
||||
private $degree;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->image = "";
|
||||
$this->imageKey = "";
|
||||
$this->gravity = "";
|
||||
$this->dx = "";
|
||||
$this->dy = "";
|
||||
@ -27,6 +30,7 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
$this->spcent = "";
|
||||
$this->dissolve = "";
|
||||
$this->batch = "";
|
||||
$this->spacing = "";
|
||||
$this->degree = "";
|
||||
}
|
||||
|
||||
@ -38,6 +42,14 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
$this->image = "/image/" . $this->ciBase64($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果您在添加水印时不希望暴露水印所在的图片地址,可使用该参数。
|
||||
* @param $value
|
||||
*/
|
||||
public function setImageKey($value) {
|
||||
$this->imageKey = "/image_key/" . $this->ciBase64($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片水印位置,九宫格位置(参考九宫格方位图 ),默认值 SouthEast
|
||||
* @param $value
|
||||
@ -110,6 +122,14 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
$this->batch = "/batch/" . $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平铺水印功能,宽高百分比
|
||||
* @param $value
|
||||
*/
|
||||
public function setSpacing($value) {
|
||||
$this->spacing = "/spacing/" . $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当 batch 值为1时生效。图片水印的旋转角度设置,取值范围为0 - 360,默认0
|
||||
* @param $value
|
||||
@ -122,6 +142,10 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
public function getImageKey() {
|
||||
return $this->imageKey;
|
||||
}
|
||||
|
||||
public function getGravity() {
|
||||
return $this->gravity;
|
||||
}
|
||||
@ -154,6 +178,10 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
return $this->batch;
|
||||
}
|
||||
|
||||
public function getSpacing() {
|
||||
return $this->spacing;
|
||||
}
|
||||
|
||||
public function getDegree() {
|
||||
return $this->degree;
|
||||
}
|
||||
@ -164,6 +192,9 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
if($this->image) {
|
||||
$res .= $this->image;
|
||||
}
|
||||
if($this->imageKey) {
|
||||
$res .= $this->imageKey;
|
||||
}
|
||||
if($this->gravity) {
|
||||
$res .= $this->gravity;
|
||||
}
|
||||
@ -188,6 +219,9 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
if($this->batch) {
|
||||
$res .= $this->batch;
|
||||
}
|
||||
if($this->spacing) {
|
||||
$res .= $this->spacing;
|
||||
}
|
||||
if($this->degree) {
|
||||
$res .= $this->degree;
|
||||
}
|
||||
@ -199,6 +233,7 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
|
||||
public function resetRule() {
|
||||
$this->image = "";
|
||||
$this->imageKey = "";
|
||||
$this->gravity = "";
|
||||
$this->dx = "";
|
||||
$this->dy = "";
|
||||
@ -207,6 +242,7 @@ class ImageWatermarkTemplate extends ImageTemplate
|
||||
$this->spcent = "";
|
||||
$this->dissolve = "";
|
||||
$this->batch = "";
|
||||
$this->spacing = "";
|
||||
$this->degree = "";
|
||||
}
|
||||
}
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php
vendored
Executable file → Normal file
14
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php
vendored
Executable file → Normal file
14
vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php
vendored
Executable file → Normal file
@ -16,6 +16,7 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
private $dx;
|
||||
private $dy;
|
||||
private $batch;
|
||||
private $spacing;
|
||||
private $degree;
|
||||
private $shadow;
|
||||
private $scatype;
|
||||
@ -32,6 +33,7 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
$this->dx = "";
|
||||
$this->dy = "";
|
||||
$this->batch = "";
|
||||
$this->spacing = "";
|
||||
$this->degree = "";
|
||||
$this->shadow = "";
|
||||
$this->scatype = "";
|
||||
@ -74,6 +76,10 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
$this->batch = "/batch/" . $value;
|
||||
}
|
||||
|
||||
public function setSpacing($value) {
|
||||
$this->spacing = "/spacing/" . $value;
|
||||
}
|
||||
|
||||
public function setDegree($value) {
|
||||
$this->degree = "/degree/" . $value;
|
||||
}
|
||||
@ -126,6 +132,10 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
return $this->batch;
|
||||
}
|
||||
|
||||
public function getSpacing() {
|
||||
return $this->spacing;
|
||||
}
|
||||
|
||||
public function getDegree() {
|
||||
return $this->degree;
|
||||
}
|
||||
@ -172,6 +182,9 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
if($this->batch) {
|
||||
$res .= $this->batch;
|
||||
}
|
||||
if($this->spacing) {
|
||||
$res .= $this->spacing;
|
||||
}
|
||||
if($this->degree) {
|
||||
$res .= $this->degree;
|
||||
}
|
||||
@ -200,6 +213,7 @@ class TextWatermarkTemplate extends ImageTemplate
|
||||
$this->dx = "";
|
||||
$this->dy = "";
|
||||
$this->batch = "";
|
||||
$this->spacing = "";
|
||||
$this->degree = "";
|
||||
$this->shadow = "";
|
||||
$this->scatype = "";
|
||||
|
||||
7
vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php
vendored
Executable file → Normal file
7
vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php
vendored
Executable file → Normal file
@ -18,6 +18,10 @@ class MultipartUpload {
|
||||
private $progress;
|
||||
private $totalSize;
|
||||
private $uploadedSize;
|
||||
private $concurrency;
|
||||
private $partNumberList;
|
||||
private $needMd5;
|
||||
private $retry;
|
||||
|
||||
public function __construct($client, $body, $options = array()) {
|
||||
$minPartSize = $options['PartSize'];
|
||||
@ -35,6 +39,7 @@ class MultipartUpload {
|
||||
$this->needMd5 = isset($options['ContentMD5']) ? $options['ContentMD5'] : true;
|
||||
$this->retry = isset($options['Retry']) ? $options['Retry'] : 3;
|
||||
}
|
||||
|
||||
public function performUploading() {
|
||||
$uploadId= $this->initiateMultipartUpload();
|
||||
$this->uploadParts($uploadId);
|
||||
@ -51,6 +56,7 @@ class MultipartUpload {
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function uploadParts($uploadId) {
|
||||
$uploadRequests = function ($uploadId) {
|
||||
$partNumber = 1;
|
||||
@ -163,5 +169,4 @@ class MultipartUpload {
|
||||
$result = $this->client->createMultipartUpload($this->options);
|
||||
return $result['UploadId'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
vendor/qcloud/cos-sdk-v5/src/RangeDownload.php
vendored
Executable file → Normal file
15
vendor/qcloud/cos-sdk-v5/src/RangeDownload.php
vendored
Executable file → Normal file
@ -14,21 +14,27 @@ class RangeDownload {
|
||||
private $progress;
|
||||
private $totalSize;
|
||||
private $resumableJson;
|
||||
private $concurrency;
|
||||
private $partNumberList;
|
||||
private $downloadedSize;
|
||||
private $saveAs;
|
||||
private $resumableTaskFile;
|
||||
private $resumableDownload;
|
||||
private $resumableJsonLocal;
|
||||
private $fp;
|
||||
private $fp_resume;
|
||||
|
||||
public function __construct( $client, $contentLength, $saveAs, $options = array() ) {
|
||||
$this->client = $client;
|
||||
$this->options = $options;
|
||||
$this->partSize = isset( $options['PartSize'] ) ? $options['PartSize'] : self::DEFAULT_PART_SIZE;
|
||||
$this->concurrency = isset( $options['Concurrency'] ) ? $options['Concurrency'] : 10;
|
||||
$this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totalSize, $downloadedSize ) {
|
||||
}
|
||||
;
|
||||
$this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totalSize, $downloadedSize ) {};
|
||||
$this->parts = [];
|
||||
$this->partNumberList = [];
|
||||
$this->downloadedSize = 0;
|
||||
$this->totalSize = $contentLength;
|
||||
$this->saveAs = $saveAs;
|
||||
$this->resumableJson = [];
|
||||
$this->resumableJson = isset( $options['ResumableJson'] ) ? $options['ResumableJson'] : [];
|
||||
unset( $options['ResumableJson'] );
|
||||
$this->resumableTaskFile = isset( $options['ResumableTaskFile'] ) ? $options['ResumableTaskFile'] : $saveAs . '.cosresumabletask';
|
||||
@ -141,5 +147,4 @@ class RangeDownload {
|
||||
$promise = $pool->promise();
|
||||
$promise->wait();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Request/XmlLocation.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Request/XmlLocation.php
vendored
Executable file → Normal file
38
vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php
vendored
Executable file → Normal file
38
vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php
vendored
Executable file → Normal file
@ -57,8 +57,8 @@ class ResultTransformer {
|
||||
$result['Bucket'] = $command['Bucket'];
|
||||
}
|
||||
$result['Location'] = $request->getHeader('Host')[0] . $request->getUri()->getPath();
|
||||
if ($this->config['locationWithSchema']) {
|
||||
$result['Location'] = $this->config['schema'] . '://' . $result['Location'];
|
||||
if ($this->config['locationWithScheme']) {
|
||||
$result['Location'] = $this->config['scheme'] . '://' . $result['Location'];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -86,6 +86,9 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$xmlData = json_decode(json_encode($obj),true);
|
||||
if ($picRuleSize == 1 && isset($xmlData['ProcessResults']['Object'])){
|
||||
@ -101,6 +104,9 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$arr = json_decode(json_encode($obj),true);
|
||||
$result['GuetzliStatus'] = isset($arr[0]) ? $arr[0] : '';
|
||||
@ -111,6 +117,9 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$arr = json_decode(json_encode($obj),true);
|
||||
$result['CIStatus'] = isset($arr[0]) ? $arr[0] : '';
|
||||
@ -122,6 +131,9 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$arr = json_decode(json_encode($obj),true);
|
||||
$result['OriginProtectStatus'] = isset($arr[0]) ? $arr[0] : '';
|
||||
@ -133,6 +145,9 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$arr = json_decode(json_encode($obj),true);
|
||||
$result['Hotlink'] = $arr;
|
||||
@ -140,6 +155,20 @@ class ResultTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "AutoTranslationBlockProcess") {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$arr = json_decode(json_encode($obj),true);
|
||||
$result['TranslationResult'] = isset($arr[0]) ? $arr[0] : '';
|
||||
unset($result['Body']);
|
||||
}
|
||||
}
|
||||
|
||||
$xml2JsonActions = array(
|
||||
'CreateMediaTranscodeJobs' => 1,
|
||||
'CreateMediaJobs' => 1,
|
||||
@ -161,7 +190,6 @@ class ResultTransformer {
|
||||
'CreateMediaSDRtoHDRJobs' => 1,
|
||||
'CreateMediaDigitalWatermarkJobs' => 1,
|
||||
'CreateMediaExtractDigitalWatermarkJobs' => 1,
|
||||
'OpticalOcrRecognition' => 1,
|
||||
'GetWorkflowInstance' => 1,
|
||||
'CreateMediaTranscodeTemplate' => 1,
|
||||
'UpdateMediaTranscodeTemplate' => 1,
|
||||
@ -194,9 +222,13 @@ class ResultTransformer {
|
||||
$length = intval($result['ContentLength']);
|
||||
if($length > 0){
|
||||
$content = $this->geCiContentInfo($result, $length);
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
$obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA);
|
||||
$xmlData = json_decode(json_encode($obj),true);
|
||||
$result['Response'] = $xmlData;
|
||||
unset($result['Body']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/Serializer.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/Serializer.php
vendored
Executable file → Normal file
110
vendor/qcloud/cos-sdk-v5/src/Service.php
vendored
Executable file → Normal file
110
vendor/qcloud/cos-sdk-v5/src/Service.php
vendored
Executable file → Normal file
@ -1562,7 +1562,7 @@ class Service {
|
||||
),
|
||||
)
|
||||
),
|
||||
// 设置存储桶(Bucket)的访问权限(Access Control List, ACL)
|
||||
// 设置存储桶(Bucket)的访问权限 (Access Control List, ACL)
|
||||
'PutBucketAcl' => array(
|
||||
'httpMethod' => 'PUT',
|
||||
'uri' => '/{Bucket}?acl',
|
||||
@ -3710,6 +3710,7 @@ class Service {
|
||||
'DescribeDocProcessJob' => Descriptions::DescribeDocProcessJob(), // 查询文档转码任务
|
||||
'GetDescribeDocProcessJobs' => Descriptions::GetDescribeDocProcessJobs(), // 拉取符合条件的文档转码任务
|
||||
'DetectImage' => Descriptions::DetectImage(), // 图片审核
|
||||
'DetectImageUrl' => Descriptions::DetectImageUrl(), // 图片审核
|
||||
'DetectImages' => Descriptions::DetectImages(), // 图片审核-批量
|
||||
'DetectVirus' => Descriptions::DetectVirus(), // 云查毒
|
||||
'GetDetectVirusResult' => Descriptions::GetDetectVirusResult(), // 查询病毒检测任务结果
|
||||
@ -3786,6 +3787,7 @@ class Service {
|
||||
'CloseOriginProtect' => Descriptions::CloseOriginProtect(), // 关闭原图保护
|
||||
'ImageDetectFace' => Descriptions::ImageDetectFace(), // 人脸检测
|
||||
'ImageFaceEffect' => Descriptions::ImageFaceEffect(), // 人脸特效
|
||||
'ImageUrlFaceEffect' => Descriptions::ImageUrlFaceEffect(), // 人脸特效
|
||||
'IDCardOCR' => Descriptions::IDCardOCR(), // 身份证识别
|
||||
'IDCardOCRByUpload' => Descriptions::IDCardOCRByUpload(), // 身份证识别-上传时处理
|
||||
'GetLiveCode' => Descriptions::GetLiveCode(), // 获取数字验证码
|
||||
@ -3810,6 +3812,7 @@ class Service {
|
||||
'GetPicBucketList' => Descriptions::GetPicBucketList(), // 查询图片处理服务状态
|
||||
'GetAiBucketList' => Descriptions::GetAiBucketList(), // 查询 AI 内容识别服务状态
|
||||
'OpenAiService' => Descriptions::OpenAiService(), // 开通 AI 内容识别
|
||||
'CloseAiService' => Descriptions::CloseAiService(), // 关闭AI内容识别服务
|
||||
'GetAiQueueList' => Descriptions::GetAiQueueList(), // 搜索 AI 内容识别队列
|
||||
'UpdateAiQueue' => Descriptions::UpdateAiQueue(), // 更新 AI 内容识别队列
|
||||
'CreateMediaTranscodeProTemplate' => Descriptions::CreateMediaTranscodeProTemplate(), // 创建音视频转码 pro 模板
|
||||
@ -3830,6 +3833,48 @@ class Service {
|
||||
'OpenImageSlim' => Descriptions::OpenImageSlim(), // 开通图片瘦身
|
||||
'CloseImageSlim' => Descriptions::CloseImageSlim(), // 关闭图片瘦身
|
||||
'GetImageSlim' => Descriptions::GetImageSlim(), // 查询图片瘦身状态
|
||||
'AutoTranslationBlockProcess' => Descriptions::AutoTranslationBlockProcess(), // 实时文字翻译
|
||||
'RecognizeLogoProcess' => Descriptions::RecognizeLogoProcess(), // Logo 识别
|
||||
'DetectLabelProcess' => Descriptions::DetectLabelProcess(), // 图片标签
|
||||
'AIGameRecProcess' => Descriptions::AIGameRecProcess(), // 游戏场景识别
|
||||
'AIBodyRecognitionProcess' => Descriptions::AIBodyRecognitionProcess(), // 人体识别
|
||||
'DetectPetProcess' => Descriptions::DetectPetProcess(), // 宠物识别
|
||||
'AILicenseRecProcess' => Descriptions::AILicenseRecProcess(), // 卡证识别
|
||||
'CreateMediaTargetRecTemplate' => Descriptions::CreateMediaTargetRecTemplate(), // 创建视频目标检测模板
|
||||
'UpdateMediaTargetRecTemplate' => Descriptions::UpdateMediaTargetRecTemplate(), // 更新视频目标检测模板
|
||||
'CreateMediaTargetRecJobs' => Descriptions::CreateMediaTargetRecJobs(), // 提交视频目标检测任务
|
||||
'CreateMediaSegmentVideoBodyJobs' => Descriptions::CreateMediaSegmentVideoBodyJobs(), // 提交视频人像抠图任务
|
||||
'OpenAsrService' => Descriptions::OpenAsrService(), //开通智能语音服务
|
||||
'GetAsrBucketList' => Descriptions::GetAsrBucketList(), // 查询智能语音服务
|
||||
'CloseAsrService' => Descriptions::CloseAsrService(), // 关闭智能语音服务
|
||||
'GetAsrQueueList' => Descriptions::GetAsrQueueList(), // 查询智能语音队列
|
||||
'UpdateAsrQueue' => Descriptions::UpdateAsrQueue(), // 更新智能语音队列
|
||||
'CreateMediaNoiseReductionTemplate' => Descriptions::CreateMediaNoiseReductionTemplate(), // 创建音频降噪模板
|
||||
'UpdateMediaNoiseReductionTemplate' => Descriptions::UpdateMediaNoiseReductionTemplate(), // 更新音频降噪模板
|
||||
'CreateVoiceSoundHoundJobs' => Descriptions::CreateVoiceSoundHoundJobs(), // 提交听歌识曲任务
|
||||
'CreateVoiceVocalScoreJobs' => Descriptions::CreateVoiceVocalScoreJobs(), // 提交音乐评分任务
|
||||
'CreateDataset' => Descriptions::CreateDataset(), // 创建数据集
|
||||
'CreateDatasetBinding' => Descriptions::CreateDatasetBinding(), // 绑定存储桶与数据集
|
||||
'CreateFileMetaIndex' => Descriptions::CreateFileMetaIndex(), // 创建元数据索引
|
||||
'DatasetFaceSearch' => Descriptions::DatasetFaceSearch(), // 人脸搜索
|
||||
'DatasetSimpleQuery' => Descriptions::DatasetSimpleQuery(), // 简单查询
|
||||
'DeleteDataset' => Descriptions::DeleteDataset(), // 删除数据集
|
||||
'DeleteDatasetBinding' => Descriptions::DeleteDatasetBinding(), // 解绑存储桶与数据集
|
||||
'DeleteFileMetaIndex' => Descriptions::DeleteFileMetaIndex(), // 删除元数据索引
|
||||
'DescribeDataset' => Descriptions::DescribeDataset(), // 查询数据集
|
||||
'DescribeDatasetBinding' => Descriptions::DescribeDatasetBinding(), // 查询数据集与存储桶的绑定关系
|
||||
'DescribeDatasetBindings' => Descriptions::DescribeDatasetBindings(), // 查询绑定关系列表
|
||||
'DescribeDatasets' => Descriptions::DescribeDatasets(), // 列出数据集
|
||||
'DescribeFileMetaIndex' => Descriptions::DescribeFileMetaIndex(), // 查询元数据索引
|
||||
'SearchImage' => Descriptions::SearchImage(), // 图像检索
|
||||
'UpdateDataset' => Descriptions::UpdateDataset(), // 更新数据集
|
||||
'UpdateFileMetaIndex' => Descriptions::UpdateFileMetaIndex(), // 更新元数据索引
|
||||
'ZipFilePreview' => Descriptions::ZipFilePreview(), // 压缩包预览同步请求
|
||||
'GetHLSPlayKey' => Descriptions::GetHLSPlayKey(), // 获取hls播放密钥
|
||||
'PostWatermarkJobs' => Descriptions::PostWatermarkJobs(), // 视频明水印-提交任务
|
||||
'GeneratePlayList' => Descriptions::GeneratePlayList(), // 生成播放列表
|
||||
'CreateWatermarkTemplate' => Descriptions::CreateWatermarkTemplate(), // 创建明水印模板
|
||||
|
||||
),
|
||||
'models' => array(
|
||||
'AbortMultipartUploadOutput' => array(
|
||||
@ -5621,11 +5666,21 @@ class Service {
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'Name' => array(
|
||||
'type' => 'string',
|
||||
),
|
||||
'CreationDate' => array(
|
||||
'type' => 'string',
|
||||
'Bucket' => array(
|
||||
'type' => 'array',
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'items' => array(
|
||||
'properties' => array(
|
||||
'Name' => array(
|
||||
'type' => 'string',
|
||||
),
|
||||
'CreationDate' => array(
|
||||
'type' => 'string',
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -7453,6 +7508,7 @@ class Service {
|
||||
'GetPicBucketListOutput' => Descriptions::GetPicBucketListOutput(),
|
||||
'GetAiBucketListOutput' => Descriptions::GetAiBucketListOutput(),
|
||||
'OpenAiServiceOutput' => Descriptions::OpenAiServiceOutput(),
|
||||
'CloseAiServiceOutput' => Descriptions::CloseAiServiceOutput(),
|
||||
'GetAiQueueListOutput' => Descriptions::GetAiQueueListOutput(),
|
||||
'UpdateAiQueueOutput' => Descriptions::UpdateAiQueueOutput(),
|
||||
'CreateMediaTranscodeProTemplateOutput' => Descriptions::CreateMediaTranscodeProTemplateOutput(),
|
||||
@ -7473,6 +7529,48 @@ class Service {
|
||||
'OpenImageSlimOutput' => Descriptions::OpenImageSlimOutput(),
|
||||
'CloseImageSlimOutput' => Descriptions::CloseImageSlimOutput(),
|
||||
'GetImageSlimOutput' => Descriptions::GetImageSlimOutput(),
|
||||
'AutoTranslationBlockProcessOutput' => Descriptions::AutoTranslationBlockProcessOutput(),
|
||||
'RecognizeLogoProcessOutput' => Descriptions::RecognizeLogoProcessOutput(),
|
||||
'DetectLabelProcessOutput' => Descriptions::DetectLabelProcessOutput(),
|
||||
'AIGameRecProcessOutput' => Descriptions::AIGameRecProcessOutput(),
|
||||
'AIBodyRecognitionProcessOutput' => Descriptions::AIBodyRecognitionProcessOutput(),
|
||||
'DetectPetProcessOutput' => Descriptions::DetectPetProcessOutput(),
|
||||
'AILicenseRecProcessOutput' => Descriptions::AILicenseRecProcessOutput(),
|
||||
'CreateMediaTargetRecTemplateOutput' => Descriptions::CreateMediaTargetRecTemplateOutput(),
|
||||
'UpdateMediaTargetRecTemplateOutput' => Descriptions::UpdateMediaTargetRecTemplateOutput(),
|
||||
'CreateMediaTargetRecJobsOutput' => Descriptions::CreateMediaTargetRecJobsOutput(),
|
||||
'CreateMediaSegmentVideoBodyJobsOutput' => Descriptions::CreateMediaSegmentVideoBodyJobsOutput(),
|
||||
'OpenAsrServiceOutput' => Descriptions::OpenAsrServiceOutput(),
|
||||
'GetAsrBucketListOutput' => Descriptions::GetAsrBucketListOutput(),
|
||||
'CloseAsrServiceOutput' => Descriptions::CloseAsrServiceOutput(),
|
||||
'GetAsrQueueListOutput' => Descriptions::GetAsrQueueListOutput(),
|
||||
'UpdateAsrQueueOutput' => Descriptions::UpdateAsrQueueOutput(),
|
||||
'CreateMediaNoiseReductionTemplateOutput' => Descriptions::CreateMediaNoiseReductionTemplateOutput(),
|
||||
'UpdateMediaNoiseReductionTemplateOutput' => Descriptions::UpdateMediaNoiseReductionTemplateOutput(),
|
||||
'CreateVoiceSoundHoundJobsOutput' => Descriptions::CreateVoiceSoundHoundJobsOutput(),
|
||||
'CreateVoiceVocalScoreJobsOutput' => Descriptions::CreateVoiceVocalScoreJobsOutput(),
|
||||
'CreateDatasetOutput' => Descriptions::CreateDatasetOutput(),
|
||||
'CreateDatasetBindingOutput' => Descriptions::CreateDatasetBindingOutput(),
|
||||
'CreateFileMetaIndexOutput' => Descriptions::CreateFileMetaIndexOutput(),
|
||||
'DatasetFaceSearchOutput' => Descriptions::DatasetFaceSearchOutput(),
|
||||
'DatasetSimpleQueryOutput' => Descriptions::DatasetSimpleQueryOutput(),
|
||||
'DeleteDatasetOutput' => Descriptions::DeleteDatasetOutput(),
|
||||
'DeleteDatasetBindingOutput' => Descriptions::DeleteDatasetBindingOutput(),
|
||||
'DeleteFileMetaIndexOutput' => Descriptions::DeleteFileMetaIndexOutput(),
|
||||
'DescribeDatasetOutput' => Descriptions::DescribeDatasetOutput(),
|
||||
'DescribeDatasetBindingOutput' => Descriptions::DescribeDatasetBindingOutput(),
|
||||
'DescribeDatasetBindingsOutput' => Descriptions::DescribeDatasetBindingsOutput(),
|
||||
'DescribeDatasetsOutput' => Descriptions::DescribeDatasetsOutput(),
|
||||
'DescribeFileMetaIndexOutput' => Descriptions::DescribeFileMetaIndexOutput(),
|
||||
'SearchImageOutput' => Descriptions::SearchImageOutput(),
|
||||
'UpdateDatasetOutput' => Descriptions::UpdateDatasetOutput(),
|
||||
'UpdateFileMetaIndexOutput' => Descriptions::UpdateFileMetaIndexOutput(),
|
||||
'ZipFilePreviewOutput' => Descriptions::ZipFilePreviewOutput(),
|
||||
'GetHLSPlayKeyOutput' => Descriptions::GetHLSPlayKeyOutput(),
|
||||
'PostWatermarkJobsOutput' => Descriptions::PostWatermarkJobsOutput(),
|
||||
'GeneratePlayListOutput' => Descriptions::GeneratePlayListOutput(),
|
||||
'CreateWatermarkTemplateOutput' => Descriptions::CreateWatermarkTemplateOutput(),
|
||||
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
5
vendor/qcloud/cos-sdk-v5/src/Signature.php
vendored
Executable file → Normal file
5
vendor/qcloud/cos-sdk-v5/src/Signature.php
vendored
Executable file → Normal file
@ -32,7 +32,6 @@ class Signature {
|
||||
'content-length',
|
||||
'content-md5',
|
||||
'content-type',
|
||||
'expect',
|
||||
'expires',
|
||||
'host',
|
||||
'if-match',
|
||||
@ -42,6 +41,7 @@ class Signature {
|
||||
'origin',
|
||||
'range',
|
||||
'transfer-encoding',
|
||||
'pic-operations',
|
||||
];
|
||||
date_default_timezone_set($this->options['timezone']);
|
||||
}
|
||||
@ -53,6 +53,9 @@ class Signature {
|
||||
if ( startWith( $header, 'x-cos-' ) ) {
|
||||
return true;
|
||||
}
|
||||
if ( startWith( $header, 'x-ci-' ) ) {
|
||||
return true;
|
||||
}
|
||||
if ( in_array( $header, $this->signHeader ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
0
vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php
vendored
Executable file → Normal file
0
vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php
vendored
Executable file → Normal file
Reference in New Issue
Block a user