first commit
This commit is contained in:
30
vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php
vendored
Normal file
30
vendor/qcloud/cos-sdk-v5/sample/ImageSearch.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__) . '/../vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 图片搜索接口 https://cloud.tencent.com/document/product/460/63901
|
||||
$result = $cosClient->imageSearch(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // ObjectKey
|
||||
'MatchThreshold' => 0, // 出参 Score 中,只有超过 MatchThreshold 值的结果才会返回。默认为0
|
||||
'Offset' => 0, // 起始序号,默认值为0
|
||||
'Limit' => 10, // 返回数量,默认值为10,最大值为100
|
||||
'Filter' => '', // 针对入库时提交的 Tags 信息进行条件过滤。支持>、>=、<、<=、=、!=,多个条件之间支持 AND 和 OR 进行连接
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/ImageSearchAdd.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__) . '/../vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 添加图库图片 https://cloud.tencent.com/document/product/460/63900
|
||||
$result = $cosClient->imageSearchAdd(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // ObjectKey
|
||||
'EntityId' => '', // 物品 ID,最多支持64个字符。若 EntityId 已存在,则对其追加图片
|
||||
'CustomContent' => '', // 用户自定义的内容,最多支持4096个字符,查询时原样带回
|
||||
'Tags' => '', // 图片自定义标签,最多不超过10个,json 字符串,格式为 key:value 对
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
27
vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php
vendored
Normal file
27
vendor/qcloud/cos-sdk-v5/sample/ImageSearchDelete.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__) . '/../vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 删除图库图片 https://cloud.tencent.com/document/product/460/63902
|
||||
$result = $cosClient->imageSearchDelete(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // ObjectKey
|
||||
'EntityId' => '', // 物品 ID
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
27
vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php
vendored
Normal file
27
vendor/qcloud/cos-sdk-v5/sample/ImageSearchOpen.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__) . '/../vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 开通以图搜图 https://cloud.tencent.com/document/product/460/63899
|
||||
$result = $cosClient->imageSearchOpen(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'MaxCapacity' => 10000, // 图库容量限制
|
||||
'MaxQps' => 10, // 图库访问限制,默认10
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->abortMultipartUpload(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'UploadId' => 'string',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
30
vendor/qcloud/cos-sdk-v5/sample/addHotLink.php
vendored
Normal file
30
vendor/qcloud/cos-sdk-v5/sample/addHotLink.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 设置防盗链 https://cloud.tencent.com/document/product/460/30116
|
||||
$result = $cosClient->addHotLink(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Urls' => array(
|
||||
'www.example1.com',
|
||||
'www.example2.com',
|
||||
'www.example3.com',
|
||||
),
|
||||
'Type' => 'white',
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
36
vendor/qcloud/cos-sdk-v5/sample/appendObject.php
vendored
Normal file
36
vendor/qcloud/cos-sdk-v5/sample/appendObject.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
$result = $cosClient->appendObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'Position' => 0, //追加对象位置
|
||||
'Body' => fopen($local_path, 'rb'),//读取文件内容
|
||||
));
|
||||
/*
|
||||
$result = $cosClient->appendObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'Position' => (integer)$result['Position'], //取出上一个追加文件的对象位置进行追加
|
||||
'Body' => "hello", //文件流
|
||||
));
|
||||
*/
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/bindCiService.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/bindCiService.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 绑定数据万象服务 https://cloud.tencent.com/document/product/460/30108
|
||||
$result = $cosClient->bindCiService(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate();
|
||||
$blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg");
|
||||
$blindWatermarkTemplate->setType(2);
|
||||
$blindWatermarkTemplate->setLevel(3);
|
||||
$result = $cosClient->getObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'ImageHandleParam' => $blindWatermarkTemplate->queryString(),
|
||||
'SaveAs' => '/data/exampleobject'
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/cancelInventoryTriggerJob.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/71515 取消存量任务
|
||||
$result = $cosClient->cancelInventoryTriggerJob(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // jobId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/cancelLiveVideoAuditing.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->cancelLiveVideoAuditing(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // jobId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/catchException.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/catchException.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketAcl(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
$statusCode = $e->getStatusCode(); // 获取错误码
|
||||
$errorMessage = $e->getMessage(); // 获取错误信息
|
||||
$requestId = $e->getRequestId(); // 获取错误的requestId
|
||||
$errorCode = $e->getCosErrorCode(); // 获取错误名称
|
||||
$request = $e->getRequest(); // 获取完整的请求
|
||||
$response = $e->getResponse(); // 获取完整的响应
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate();
|
||||
$imageMogrTemplate->thumbnailByScale(50);
|
||||
$imageMogrTemplate->rotate(50);
|
||||
$imageViewTemplate = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate();
|
||||
$imageViewTemplate->setMode(1);
|
||||
$imageViewTemplate->setWidth(400);
|
||||
$imageViewTemplate->setHeight(600);
|
||||
$imageViewTemplate->setQuality(1, 85);
|
||||
$ciParamTransformation = new Qcloud\Cos\ImageParamTemplate\CIParamTransformation();
|
||||
$ciParamTransformation->addRule($imageMogrTemplate);
|
||||
$ciParamTransformation->addRule($imageViewTemplate);
|
||||
$result = $cosClient->getObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'ImageHandleParam' => $ciParamTransformation->queryString(),
|
||||
'SaveAs' => '/data/exampleobject',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/closeOriginProtect.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 关闭原图保护 https://cloud.tencent.com/document/product/460/30122
|
||||
$result = $cosClient->closeOriginProtect(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
36
vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php
vendored
Normal file
36
vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->completeMultipartUpload(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'UploadId' => 'string',
|
||||
'Parts' => array(
|
||||
array(
|
||||
'ETag' => 'string',
|
||||
'PartNumber' => integer,
|
||||
),
|
||||
array(
|
||||
'ETag' => 'string',
|
||||
'PartNumber' => integer,
|
||||
)),
|
||||
// ... repeated
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/copy.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/copy.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
$result = $cosClient->copy(
|
||||
$bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
$key = 'exampleobject',
|
||||
$copySource = array(
|
||||
'Region' => '<sourceRegion>',
|
||||
'Bucket' => '<sourceBucket>',
|
||||
'Key' => '<sourceKey>',
|
||||
)
|
||||
);
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
27
vendor/qcloud/cos-sdk-v5/sample/copyObject.php
vendored
Normal file
27
vendor/qcloud/cos-sdk-v5/sample/copyObject.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->copyObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'CopySource' => urlencode('examplebucket2-125000000.cos.ap-guangzhou.myqcloud.com/exampleobject'), //请注意这里需要urlencode,防止因特殊字符产生的400或404错误
|
||||
'MetadataDirective' => 'Replaced',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
30
vendor/qcloud/cos-sdk-v5/sample/cosClient.php
vendored
Normal file
30
vendor/qcloud/cos-sdk-v5/sample/cosClient.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$token = "COS_TMPTOKEN"; //如果使用永久密钥不需要填入token,如果使用临时密钥需要填入,临时密钥生成和使用指引参见https://cloud.tencent.com/document/product/436/14048
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region, //园区
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'timeout' => 10, //超时时间
|
||||
'connect_timeout' => 10, //连接超时时间
|
||||
'ip' => '', //ip
|
||||
'port' => '', //端口
|
||||
'endpoint' => '', //endpoint
|
||||
'domain' => '', //domain可以填写用户自定义域名,或者桶的全球加速域名
|
||||
'proxy' => '', //代理服务器
|
||||
'retry' => 10, //重试次数
|
||||
'userAgent' => '', //UA
|
||||
'allow_redirects' => false, //是否follow302
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey,
|
||||
'token' => $token,
|
||||
'anonymous' => true, //匿名模式
|
||||
)
|
||||
)
|
||||
);
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/createBucket.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/createBucket.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createBucket(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
49
vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php
vendored
Normal file
49
vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createDocProcessJobs(array(
|
||||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值
|
||||
'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //任务所在的队列 ID
|
||||
'Input' => array(
|
||||
'Object' => 'Append功能测试.pdf' //待操作的文件对象
|
||||
),
|
||||
'Operation' => array(
|
||||
'DocProcess' => array(
|
||||
'SrcType' => 'pdf', //源数据的后缀类型
|
||||
'TgtType' => 'png', //转换输出目标文件类型
|
||||
'SheetId' => 0, //表格文件参数,转换第 X 个表,默认为1
|
||||
'StartPage' => 1, //从第 X 页开始转换,默认为1
|
||||
'EndPage' => 3, //转换至第 X 页,默认为-1,即转换全部页
|
||||
'ImageParams' => '', //转换后的图片处理参数
|
||||
'DocPassword' => '', //Office 文档的打开密码
|
||||
'Comments' => 0, //是否隐藏批注和应用修订,默认为 0
|
||||
'PaperDirection' => 0, //表格文件转换纸张方向,默认为0
|
||||
'Quality' => 100, //生成预览图的图片质量,取值范围 [1-100],默认值100
|
||||
'Zoom' => 100, //预览图片的缩放参数,取值范围[10-200], 默认值100
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region, //存储桶的地域
|
||||
'Bucket' => 'examplebucket-1250000000', //存储结果的存储桶
|
||||
'Object' => 'pic-${Page}.jpg', //输出文件路径
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
54
vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php
vendored
Normal file
54
vendor/qcloud/cos-sdk-v5/sample/createFileCompressJobs.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/83112 提交多文件打包压缩任务-异步
|
||||
$result = $cosClient->createFileCompressJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'FileCompress',
|
||||
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
|
||||
'Operation' => array(
|
||||
'UserData' => 'xxx',
|
||||
'FileCompressConfig' => array(
|
||||
'Flatten' => '0',
|
||||
'Format' => 'zip',
|
||||
// 'UrlList' => 'test/index.csv',
|
||||
// 'Prefix' => 'test/',
|
||||
'Keys' => array(
|
||||
'object1', // 待压缩桶文件
|
||||
'object2', // 待压缩桶文件
|
||||
'object3', // 待压缩桶文件
|
||||
),
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'output/test.zip',
|
||||
),
|
||||
),
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
45
vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php
vendored
Normal file
45
vendor/qcloud/cos-sdk-v5/sample/createFileHashCodeJobs.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/83108 提交哈希值计算任务-异步
|
||||
$result = $cosClient->createFileHashCodeJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'FileHashCode',
|
||||
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
'UserData' => 'xxx',
|
||||
'FileHashCodeConfig' => array(
|
||||
'Type' => 'MD5',
|
||||
'AddToHeader' => 'true',
|
||||
),
|
||||
),
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
49
vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php
vendored
Normal file
49
vendor/qcloud/cos-sdk-v5/sample/createFileUncompressJobs.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/83110 提交文件解压任务-异步
|
||||
$result = $cosClient->createFileUncompressJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'FileUncompress',
|
||||
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
|
||||
'Input' => array(
|
||||
'Object' => 'test.zip',
|
||||
),
|
||||
'Operation' => array(
|
||||
'UserData' => 'xxx',
|
||||
'FileUncompressConfig' => array(
|
||||
'Prefix' => 'prefix',
|
||||
'PrefixReplaced' => '1',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
),
|
||||
),
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBack' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/createFolder.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/createFolder.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'folder/',
|
||||
'Body' => "",
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
39
vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php
vendored
Normal file
39
vendor/qcloud/cos-sdk-v5/sample/createInventoryTriggerJob.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/71516 触发批量存量任务
|
||||
$result = $cosClient->createInventoryTriggerJob(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Name' => '存量触发任务名称',
|
||||
'Input' => array(
|
||||
// 'Manifest' => '',
|
||||
// 'UrlFile' => '',
|
||||
// 'Prefix' => '',
|
||||
'Object' => 'test01.png',
|
||||
),
|
||||
'Operation' => array(
|
||||
'WorkflowIds' => 'w9938ed4b1435448783xxxxxxxxxxxxx',
|
||||
// 'TimeInterval' => array(
|
||||
// 'Start' => '',
|
||||
// 'End' => '',
|
||||
// ),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
85
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php
vendored
Normal file
85
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationJobs.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交动图任务 https://cloud.tencent.com/document/product/436/54001
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaAnimationJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Animation',
|
||||
'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 't1de276cbdab16xxxxxxxxxxxxxxxxxxxxx',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'Animation.gif',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaAnimationJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Animation',
|
||||
'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'Animation' => array(
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'AnimateOnlyKeepKeyFrame' => '',
|
||||
'AnimateTimeIntervalOfFrame' => '',
|
||||
'AnimateFramesPerSecond' => '',
|
||||
'Quality' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'Animation.gif',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
43
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php
vendored
Normal file
43
vendor/qcloud/cos-sdk-v5/sample/createMediaAnimationTemplate.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createMediaAnimationTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Animation',
|
||||
'Name' => 'Animation-Template-Name',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'AnimateOnlyKeepKeyFrame' => '',
|
||||
'AnimateTimeIntervalOfFrame' => '',
|
||||
'AnimateFramesPerSecond' => '',
|
||||
'Quality' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
100
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php
vendored
Normal file
100
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交拼接任务 https://cloud.tencent.com/document/product/436/54013
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaConcatJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Concat',
|
||||
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
|
||||
'CallBack' => 'https://example.com/callback',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 'asdfafiahfiushdfisdhfuis',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'concat-video02.mp4',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaConcatJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Concat',
|
||||
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
|
||||
'CallBack' => 'https://example.com/callback',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'concat-video03.mp4',
|
||||
),
|
||||
'ConcatTemplate' => array(
|
||||
'ConcatFragments' => array(
|
||||
array(
|
||||
'Url' => 'https://example.com/video01.mp4',
|
||||
'Mode' => 'Start',
|
||||
// 'StartTime' => '0',
|
||||
// 'EndTime' => '7',
|
||||
),
|
||||
array(
|
||||
'Url' => 'https://example.com/video02.mp4',
|
||||
'Mode' => 'Start',
|
||||
// 'StartTime' => '0',
|
||||
// 'EndTime' => '10',
|
||||
),
|
||||
// ... repeated
|
||||
),
|
||||
'Index' => 1,
|
||||
'Container' => array(
|
||||
'Format' => 'mp4'
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => 'mp3',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => 'H.264',
|
||||
'Bitrate' => '1000',
|
||||
'Width' => '1280',
|
||||
'Height' => '',
|
||||
'Fps' => '30',
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
56
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php
vendored
Normal file
56
vendor/qcloud/cos-sdk-v5/sample/createMediaConcatTemplate.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/54041 新增拼接模板
|
||||
$result = $cosClient->createMediaConcatTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Concat',
|
||||
'Name' => 'Concat-Template-Name',
|
||||
'ConcatTemplate' => array(
|
||||
'ConcatFragments' => array(
|
||||
array(
|
||||
'Mode' => 'Start',
|
||||
'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video01.mp4',
|
||||
),
|
||||
array(
|
||||
'Mode' => 'End',
|
||||
'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/video02.mp4',
|
||||
),
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => 'aac',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => 'h.264',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Bitrate' => '',
|
||||
'Remove' => 'false',
|
||||
),
|
||||
'Container' => array(
|
||||
'Format' => 'mp4',
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
45
vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php
vendored
Normal file
45
vendor/qcloud/cos-sdk-v5/sample/createMediaDigitalWatermarkJobs.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 嵌入数字水印任务 https://cloud.tencent.com/document/product/436/65999
|
||||
$result = $cosClient->createMediaDigitalWatermarkJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'DigitalWatermark',
|
||||
'QueueId' => 'p81e648af2aee496885707caxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'DigitalWatermark' => array(
|
||||
'Message' => '123456789ab',
|
||||
'Type' => 'Text',
|
||||
'Version' => 'V1',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'DigitalWatermark.mp4',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
39
vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php
vendored
Normal file
39
vendor/qcloud/cos-sdk-v5/sample/createMediaExtractDigitalWatermarkJobs.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提取数字水印任务 https://cloud.tencent.com/document/product/436/66007
|
||||
$result = $cosClient->createMediaExtractDigitalWatermarkJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'ExtractDigitalWatermark',
|
||||
'QueueId' => 'p81e648af2aee496885707caxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'DigitalWatermark.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'ExtractDigitalWatermark' => array(
|
||||
'Type' => 'Text',
|
||||
'Version' => 'V1',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
60
vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php
vendored
Normal file
60
vendor/qcloud/cos-sdk-v5/sample/createMediaHighSpeedHdTemplate.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/58307 新增极速高清转码模板
|
||||
$result = $cosClient->createMediaHighSpeedHdTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'HighSpeedHd',
|
||||
'Name' => 'HighSpeedHd-Template-Name',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Profile' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
'Gop' => '',
|
||||
'Preset' => '',
|
||||
'Bufsize' => '',
|
||||
'Maxrate' => '',
|
||||
'HlsTsTime' => '',
|
||||
'Pixfmt' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => '',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
),
|
||||
'TransConfig' => array(
|
||||
'IsCheckReso' => '',
|
||||
'ResoAdjMethod' => '',
|
||||
'IsHdr2Sdr' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
56
vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php
vendored
Normal file
56
vendor/qcloud/cos-sdk-v5/sample/createMediaJobs.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 多任务接口 https://cloud.tencent.com/document/product/436/58335
|
||||
$result = $cosClient->CreateMediaJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Transcode', // 可选,单一任务时,优先以Operation.Tag为准,当Operation无Tag参数时,该参数生效
|
||||
'QueueId' => 'paaf4fce5521a40888a303xxxxxxxxxxxxxx',
|
||||
'CallBack' => '',
|
||||
'Input' => array(
|
||||
'Object' => 'example.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
array(
|
||||
'Tag' => 'Transcode',
|
||||
'TemplateId' => 't04e1ab86554984f1aa17cxxxxxxxxxxxxxx',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'video01.mp4',
|
||||
),
|
||||
'WatermarkTemplateId' => array(
|
||||
't112d18d9b2a9b430e91dxxxxxxxxxxxxxx',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Tag' => 'Transcode',
|
||||
'TemplateId' => 't04e1ab86554984f1aa17xxxxxxxxxxxxxx',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'video02.mp4',
|
||||
),
|
||||
'WatermarkTemplateId' => array(
|
||||
't1bf713bb5c6a5496e859axxxxxxxxxxxxxx',
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
39
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php
vendored
Normal file
39
vendor/qcloud/cos-sdk-v5/sample/createMediaNoiseReductionJobs.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createMediaNoiseReductionJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'NoiseReduction',
|
||||
'QueueId' => 'p81e648af2aee4968857xxxxxxxxxxxxxxxx',
|
||||
'CallBack' => '',
|
||||
'Input' => array(
|
||||
'Object' => 'sound01.mp3',
|
||||
),
|
||||
'Operation' => array(
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000',
|
||||
'Object' => 'NoiseReduction.mp3',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
71
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php
vendored
Normal file
71
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessJobs.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交图片处理任务 https://cloud.tencent.com/document/product/436/67194
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaPicProcessJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'PicProcess',
|
||||
'QueueId' => 'pcf4d6d9e5e734asd0as8d09as8d09a8d0',
|
||||
'Input' => array(
|
||||
'Object' => 'test01.png'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 't1648745f76c354e8ad8a09sd890ad80a8d',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'picprocess.jpg',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaPicProcessJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'PicProcess',
|
||||
'QueueId' => 'pcf4d6d9e5e734asd0as8d09as8d09a8d0',
|
||||
'Input' => array(
|
||||
'Object' => 'test01.png'
|
||||
),
|
||||
'Operation' => array(
|
||||
'PicProcess' => array(
|
||||
'IsPicInfo' => '',
|
||||
'ProcessRule' => '',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'picprocess.jpg',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/createMediaPicProcessTemplate.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/67225 新增图片处理模板
|
||||
$result = $cosClient->createMediaPicProcessTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'PicProcess',
|
||||
'Name' => 'PicProcess-Template-Name',
|
||||
'PicProcess' => array(
|
||||
'IsPicInfo' => '',
|
||||
'ProcessRule' => 'imageMogr2/rotate/90',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
45
vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php
vendored
Normal file
45
vendor/qcloud/cos-sdk-v5/sample/createMediaQualityEstimateJobs.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交视频质量评分任务 https://cloud.tencent.com/document/product/460/76906
|
||||
$result = $cosClient->createMediaQualityEstimateJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'QualityEstimate',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
// 'QualityEstimateConfig' => array(
|
||||
// 'Rotate' => '',
|
||||
// 'Mode' => '',
|
||||
// ),
|
||||
),
|
||||
'CallBack' => 'http://xxx.com/callback',
|
||||
'CallBackFormat' => 'JSON',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
45
vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php
vendored
Normal file
45
vendor/qcloud/cos-sdk-v5/sample/createMediaSDRtoHDRJobs.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交 SDR to HDR 任务 https://cloud.tencent.com/document/product/436/60754
|
||||
$result = $cosClient->createMediaSDRtoHDRJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SDRtoHDR',
|
||||
'QueueId' => 'p81e648af2aee496885a8d09a8s09d8a0sd6',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TranscodeTemplateId' => '',
|
||||
'WatermarkTemplateId' => '',
|
||||
'SDRtoHDR' => array(
|
||||
'HdrMode' => 'HLG',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'SDRtoHDR.flv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
48
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php
vendored
Normal file
48
vendor/qcloud/cos-sdk-v5/sample/createMediaSegmentJobs.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交转封装任务 https://cloud.tencent.com/document/product/436/67186
|
||||
$result = $cosClient->createMediaSegmentJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Segment',
|
||||
'QueueId' => 'p81e648af2aee496885707ca0xxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'Segment' => array(
|
||||
'Format' => 'mkv',
|
||||
'Duration' => '5',
|
||||
'HlsEncrypt' => array(
|
||||
'IsHlsEncrypt' => 'false',
|
||||
'UriKey' => '',
|
||||
),
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000',
|
||||
'Object' => 'Segment-trans${Number}.mkv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
50
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php
vendored
Normal file
50
vendor/qcloud/cos-sdk-v5/sample/createMediaSmartCoverJobs.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交智能封面任务 https://cloud.tencent.com/document/product/436/54017
|
||||
$result = $cosClient->createMediaSmartCoverJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SmartCover',
|
||||
'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
// 'TemplateId' => '', // 使用模版
|
||||
'SmartCover' => array(
|
||||
'Format' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Count' => '',
|
||||
'DeleteDuplicates' => '',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'SmartCover-${Number}.jpg',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
// 'CallBackFormat' => '',
|
||||
// 'CallBackType' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
81
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php
vendored
Normal file
81
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交截图任务 https://cloud.tencent.com/document/product/436/76933
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaSnapshotJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Snapshot',
|
||||
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
|
||||
'CallBack' => 'https://example.com/callback',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 'asdfafiahfiushdfisdhfuis',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'snapshot-${Number}.jpg',
|
||||
// 'SpriteObject' => 'sprite-${Number}.jpg',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaSnapshotJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Snapshot',
|
||||
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
|
||||
'CallBack' => 'https://example.com/callback',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'snapshot-${Number}.jpg',
|
||||
),
|
||||
'Snapshot' => array(
|
||||
'Mode' => 'Average',
|
||||
'Start' => 3,
|
||||
'TimeInterval' => '',
|
||||
'Count' => 3,
|
||||
'Width' => '1280',
|
||||
'Height' => '',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
35
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php
vendored
Normal file
35
vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotTemplate.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/54029 新增截图模板
|
||||
$result = $cosClient->createMediaSnapshotTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Snapshot',
|
||||
'Name' => 'Snapshot-Template-Name',
|
||||
'Snapshot' => array(
|
||||
'Mode' => '',
|
||||
'Start' => '',
|
||||
'TimeInterval' => '',
|
||||
'Count' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
56
vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php
vendored
Normal file
56
vendor/qcloud/cos-sdk-v5/sample/createMediaStreamExtractJobs.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交一个音视频流分离任务 https://cloud.tencent.com/document/product/460/76911
|
||||
$result = $cosClient->createMediaStreamExtractJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'StreamExtract',
|
||||
'QueueId' => 'p81e648af2aee4968857xxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4',
|
||||
),
|
||||
'Operation' => array(
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
'Output' => array(
|
||||
'Bucket' => 'examplebucket-125000000',
|
||||
'Region' => $region,
|
||||
'StreamExtracts' => array(
|
||||
array(
|
||||
'Index' => '0',
|
||||
'Object' => 'output/out0.mp4',
|
||||
),
|
||||
array(
|
||||
'Index' => '1',
|
||||
'Object' => 'output/out1.mp4',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'CallBack' => 'http://xxx.com/callback',
|
||||
'CallBackFormat' => 'JSON',
|
||||
// 'CallBackType' => '',
|
||||
// 'CallBackMqConfig' => array(
|
||||
// 'MqRegion' => '',
|
||||
// 'MqMode' => '',
|
||||
// 'MqName' => '',
|
||||
// ),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
161
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php
vendored
Normal file
161
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionJobs.php
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交超分辨率任务 https://cloud.tencent.com/document/product/436/67210
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaSuperResolutionJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SuperResolution',
|
||||
'QueueId' => 'p81e648af2aee49688570xxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' =>'t19ea5e0c0b7054d7b904axxxxxxxxxxx',
|
||||
'TranscodeTemplateId' =>'t0b612860a293f41078xxxxxxxxxxx',
|
||||
'WatermarkTemplateId' =>'t185e2e24551b24259a02xxxxxxxxxxx',
|
||||
'DigitalWatermark' => array(
|
||||
'Message' => 'xxx',
|
||||
'Type' => 'Text',
|
||||
'Version' => 'V1',
|
||||
'IgnoreError' => 'true',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'SuperResolution.flv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaSuperResolutionJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SuperResolution',
|
||||
'QueueId' => 'p81e648af2aee49688570xxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'SuperResolution' => array(
|
||||
'Resolution' => '',
|
||||
'EnableScaleUp' => '',
|
||||
),
|
||||
'Transcode' => array(
|
||||
'Tag' => '',
|
||||
'Name' => '',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Remove' => '',
|
||||
'Profile' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
'Gop' => '',
|
||||
'Preset' => '',
|
||||
'Bufsize' => '',
|
||||
'Maxrate' => '',
|
||||
'HlsTsTime' => '',
|
||||
'Pixfmt' => '',
|
||||
'LongShortMode' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => '',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
'Remove' => '',
|
||||
'KeepTwoTracks' => '',
|
||||
'SwitchTrack' => '',
|
||||
'SampleFormat' => '',
|
||||
),
|
||||
'TransConfig' => array(
|
||||
'AdjDarMethod' => '',
|
||||
'IsCheckReso' => '',
|
||||
'ResoAdjMethod' => '',
|
||||
'IsCheckVideoBitrate' => '',
|
||||
'VideoBitrateAdjMethod' => '',
|
||||
'IsCheckAudioBitrate' => '',
|
||||
'AudioBitrateAdjMethod' => '',
|
||||
'DeleteMetadata' => '',
|
||||
'IsHdr2Sdr' => '',
|
||||
'HlsEncrypt' => array(
|
||||
'IsHlsEncrypt' => '',
|
||||
'UriKey' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
'Watermark' => array(
|
||||
'Type' => '',
|
||||
'Pos' => '',
|
||||
'LocMode' => '',
|
||||
'Dx' => '',
|
||||
'Dy' => '',
|
||||
'StartTime' => '',
|
||||
'EndTime' => '',
|
||||
'Image' => array(
|
||||
'Url' => '',
|
||||
'Mode' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Transparency' => '',
|
||||
'Background' => '',
|
||||
),
|
||||
'Text' => array(
|
||||
'FontSize' => '',
|
||||
'FontType' => '',
|
||||
'FontColor' => '',
|
||||
'Transparency' => '',
|
||||
'Text' => '',
|
||||
),
|
||||
),
|
||||
'DigitalWatermark' => array(
|
||||
'Message' => '',
|
||||
'Type' => '',
|
||||
'Version' => '',
|
||||
'IgnoreError' => '',
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'SuperResolution.flv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/createMediaSuperResolutionTemplate.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createMediaSuperResolutionTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'SuperResolution',
|
||||
'Name' => 'SuperResolution-Template-Name',
|
||||
'Resolution' => '',
|
||||
'EnableScaleUp' => '',
|
||||
'Version' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
124
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php
vendored
Normal file
124
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交转码任务 https://cloud.tencent.com/document/product/436/54009
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaTranscodeJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Transcode',
|
||||
'QueueId' => 'paaf4fce5521a40888a3034a5de80f6ca',
|
||||
'Input' => array(
|
||||
'Object' => 'example.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 't04e1ab86554984f1aa17c062fbf6c007c',
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'video02.mp4',
|
||||
),
|
||||
'Watermark' => array(
|
||||
array(
|
||||
'Type' => 'Text',
|
||||
'LocMode' => 'Absolute',
|
||||
'Dx' => '64',
|
||||
'Dy' => '64',
|
||||
'Pos' => 'TopRight',
|
||||
'Text' => array(
|
||||
'Text' => '第一个水印',
|
||||
'FontSize' => '30',
|
||||
'FontType' => 'simfang.ttf',
|
||||
'FontColor' => '#99ff00',
|
||||
'Transparency' => '100', // 不透明度
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Type' => 'Text',
|
||||
'LocMode' => 'Absolute',
|
||||
'Dx' => '64',
|
||||
'Dy' => '64',
|
||||
'Pos' => 'TopLeft',
|
||||
'Text' => array(
|
||||
'Text' => '第二个水印',
|
||||
'FontSize' => '30',
|
||||
'FontType' => 'simfang.ttf',
|
||||
'FontColor' => '#99ff00',
|
||||
'Transparency' => '100', // 不透明度
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaTranscodeJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Transcode',
|
||||
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
|
||||
'CallBack' => 'https://example.com/callback',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'video01.mkv',
|
||||
),
|
||||
'Transcode' => array(
|
||||
'Container' => array(
|
||||
'Format' => 'mp4'
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => 'H.264',
|
||||
'Profile' => 'high',
|
||||
'Bitrate' => '1000',
|
||||
'Preset' => 'medium',
|
||||
'Width' => '1280',
|
||||
'Fps' => '30',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => 'aac',
|
||||
'Samplerate' => '44100',
|
||||
'Bitrate' => '128',
|
||||
'Channels' => '4',
|
||||
),
|
||||
'TransConfig' => array(
|
||||
'AdjDarMethod' => 'scale',
|
||||
'IsCheckReso' => 'false',
|
||||
'ResoAdjMethod' => '1',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '0',
|
||||
'Duration' => '60',
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
79
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php
vendored
Normal file
79
vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeTemplate.php
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/54037 新增转码模板
|
||||
$result = $cosClient->createMediaTranscodeTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Transcode',
|
||||
'Name' => 'Transcode-Template-Name',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
'ClipConfig' => array(
|
||||
'Duration' => '',
|
||||
),
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Remove' => '',
|
||||
'Profile' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
'Gop' => '',
|
||||
'Preset' => '',
|
||||
'Bufsize' => '',
|
||||
'Maxrate' => '',
|
||||
'Pixfmt' => '',
|
||||
'LongShortMode' => '',
|
||||
'Rotate' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => '',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
'Remove' => '',
|
||||
'KeepTwoTracks' => '',
|
||||
'SwitchTrack' => '',
|
||||
'SampleFormat' => '',
|
||||
),
|
||||
'TransConfig' => array(
|
||||
'AdjDarMethod' => '',
|
||||
'IsCheckReso' => '',
|
||||
'ResoAdjMethod' => '',
|
||||
'IsCheckVideoBitrate' => '',
|
||||
'VideoBitrateAdjMethod' => '',
|
||||
'IsCheckAudioBitrate' => '',
|
||||
'AudioBitrateAdjMethod' => '',
|
||||
'DeleteMetadata' => '',
|
||||
'IsHdr2Sdr' => '',
|
||||
'HlsEncrypt' => array(
|
||||
'IsHlsEncrypt' => '',
|
||||
'UriKey' => '',
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
87
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php
vendored
Normal file
87
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交精彩集锦任务 https://cloud.tencent.com/document/product/436/58337
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaVideoMontageJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoMontage',
|
||||
'QueueId' => 'p81e648af2aeexxxxxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 't1fcc3770199e04737axxxxxxxxxxxxxx',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VideoMontage.mp4',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaVideoMontageJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoMontage',
|
||||
'QueueId' => 'p81e648af2aeexxxxxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'VideoMontage' => array(
|
||||
'Duration' => '',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => '',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
'Remove' => '',
|
||||
),
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VideoMontage.mp4',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
51
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php
vendored
Normal file
51
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageTemplate.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/58314 新增精彩集锦模板
|
||||
$result = $cosClient->createMediaVideoMontageTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoMontage',
|
||||
'Name' => 'VideoMontage-Template-Name',
|
||||
'Duration' => '',
|
||||
'Container' => array(
|
||||
'Format' => 'mp4',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => 'H.264',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => 'aac',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
'Remove' => '',
|
||||
),
|
||||
'AudioMix' => array(
|
||||
'AudioSource' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.mp3',
|
||||
'MixMode' => 'Once',
|
||||
'Replace' => 'true',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
157
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php
vendored
Normal file
157
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessJobs.php
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交视频增强任务 https://cloud.tencent.com/document/product/436/60750
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaVideoProcessJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoProcess',
|
||||
'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => 't13466f1ea41a14c0xxxxxxxxxxxxx', // 视频增强模板 ID
|
||||
'TranscodeTemplateId' => 't0b6a845f5e42847bd81xxxxxxxxxxxxx', // 转码模板 ID
|
||||
'WatermarkTemplateId' => 't185e2e24551b24259a0xxxxxxxxxxxxx', // 水印模板 ID
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VideoProcess.flv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaVideoProcessJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoProcess',
|
||||
'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'VideoProcess' => array(
|
||||
'ColorEnhance' => array(
|
||||
'Enable' => '',
|
||||
'Contrast' => '',
|
||||
'Correction' => '',
|
||||
'Saturation' => '',
|
||||
),
|
||||
'MsSharpen' => array(
|
||||
'Enable' => '',
|
||||
'SharpenLevel' => '',
|
||||
),
|
||||
),
|
||||
'Transcode' => array(
|
||||
'Tag' => '',
|
||||
'Name' => '',
|
||||
'Container' => array(
|
||||
'Format' => '',
|
||||
),
|
||||
'Video' => array(
|
||||
'Codec' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Fps' => '',
|
||||
'Remove' => '',
|
||||
'Profile' => '',
|
||||
'Bitrate' => '',
|
||||
'Crf' => '',
|
||||
'Gop' => '',
|
||||
'Preset' => '',
|
||||
'Bufsize' => '',
|
||||
'Maxrate' => '',
|
||||
'HlsTsTime' => '',
|
||||
'Pixfmt' => '',
|
||||
'LongShortMode' => '',
|
||||
),
|
||||
'TimeInterval' => array(
|
||||
'Start' => '',
|
||||
'Duration' => '',
|
||||
),
|
||||
'Audio' => array(
|
||||
'Codec' => '',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
'Remove' => '',
|
||||
'KeepTwoTracks' => '',
|
||||
'SwitchTrack' => '',
|
||||
'SampleFormat' => '',
|
||||
),
|
||||
'TransConfig' => array(
|
||||
'AdjDarMethod' => '',
|
||||
'IsCheckReso' => '',
|
||||
'ResoAdjMethod' => '',
|
||||
'IsCheckVideoBitrate' => '',
|
||||
'VideoBitrateAdjMethod' => '',
|
||||
'IsCheckAudioBitrate' => '',
|
||||
'AudioBitrateAdjMethod' => '',
|
||||
'DeleteMetadata' => '',
|
||||
'IsHdr2Sdr' => '',
|
||||
'HlsEncrypt' => array(
|
||||
'IsHlsEncrypt' => '',
|
||||
'UriKey' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
'Watermark' => array(
|
||||
'Type' => '',
|
||||
'Pos' => '',
|
||||
'LocMode' => '',
|
||||
'Dx' => '',
|
||||
'Dy' => '',
|
||||
'StartTime' => '',
|
||||
'EndTime' => '',
|
||||
'Image' => array(
|
||||
'Url' => '',
|
||||
'Mode' => '',
|
||||
'Width' => '',
|
||||
'Height' => '',
|
||||
'Transparency' => '',
|
||||
'Background' => '',
|
||||
),
|
||||
'Text' => array(
|
||||
'FontSize' => '',
|
||||
'FontType' => '',
|
||||
'FontColor' => '',
|
||||
'Transparency' => '',
|
||||
'Text' => '',
|
||||
),
|
||||
),
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VideoProcess.flv',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
37
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php
vendored
Normal file
37
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoProcessTemplate.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/60745 新增视频增强模板
|
||||
$result = $cosClient->createMediaVideoProcessTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoProcess',
|
||||
'Name' => 'VideoProcess-Template-Name',
|
||||
'ColorEnhance' => array(
|
||||
'Enable' => '',
|
||||
'Contrast' => '',
|
||||
'Correction' => '',
|
||||
'Saturation' => '',
|
||||
),
|
||||
'MsSharpen' => array(
|
||||
'Enable' => '',
|
||||
'SharpenLevel' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/createMediaVideoTagJobs.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交视频标签任务 https://cloud.tencent.com/document/product/436/67202
|
||||
$result = $cosClient->createMediaVideoTagJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VideoTag',
|
||||
'QueueId' => 'p81e648af2aee496885707ca0xxxxxxxxx',
|
||||
'Input' => array(
|
||||
'Object' => 'video01.mp4'
|
||||
),
|
||||
'Operation' => array(
|
||||
'VideoTag' => array(
|
||||
'Scenario' => 'Stream',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
'CallBack' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
77
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php
vendored
Normal file
77
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 提交人声分离任务 https://cloud.tencent.com/document/product/436/58341
|
||||
// start --------------- 使用模版 ----------------- //
|
||||
$result = $cosClient->createMediaVoiceSeparateJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VoiceSeparate',
|
||||
'QueueId' => '',
|
||||
'CallBack' => '',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp3'
|
||||
),
|
||||
'Operation' => array(
|
||||
'TemplateId' => '',
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VoiceSeparate01.mp3',
|
||||
'AuObject' => 'VoiceSeparate02.mp3',
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 使用模版 ----------------- //
|
||||
|
||||
// start --------------- 自定义参数 ----------------- //
|
||||
$result = $cosClient->createMediaVoiceSeparateJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VoiceSeparate',
|
||||
'QueueId' => '',
|
||||
'CallBack' => '',
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp3'
|
||||
),
|
||||
'Operation' => array(
|
||||
'Output' => array(
|
||||
'Region' => $region,
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Object' => 'VoiceSeparate01.mp3',
|
||||
'AuObject' => 'VoiceSeparate02.mp3',
|
||||
),
|
||||
'VoiceSeparate' => array(
|
||||
'AudioMode' => 'AudioAndBackground',
|
||||
'AudioConfig' => array(
|
||||
'Codec' => 'mp3',
|
||||
'Samplerate' => '11025',
|
||||
'Bitrate' => '256',
|
||||
'Channels' => '2',
|
||||
),
|
||||
),
|
||||
// 'UserData' => 'xxx', // 透传用户信息
|
||||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 自定义参数 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
34
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php
vendored
Normal file
34
vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateTemplate.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/58315 新增人声分离模板
|
||||
$result = $cosClient->createMediaVoiceSeparateTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'VoiceSeparate',
|
||||
'Name' => 'VoiceSeparate-Template-Name',
|
||||
'AudioMode' => 'IsAudio',
|
||||
'AudioConfig' => array(
|
||||
'Codec' => 'aac',
|
||||
'Samplerate' => '',
|
||||
'Bitrate' => '',
|
||||
'Channels' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
70
vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php
vendored
Normal file
70
vendor/qcloud/cos-sdk-v5/sample/createMediaWatermarkTemplate.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/54033 新增水印模板
|
||||
// 文本水印
|
||||
$result = $cosClient->createMediaWatermarkTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Watermark',
|
||||
'Name' => 'Watermark-Template-Name',
|
||||
'Watermark' => array(
|
||||
'Type' => 'Text',
|
||||
'Pos' => 'TopRight',
|
||||
'LocMode' => 'Absolute',
|
||||
'Dx' => '128',
|
||||
'Dy' => '128',
|
||||
'StartTime' => '',
|
||||
'EndTime' => '',
|
||||
'Text' => array(
|
||||
'FontSize' => '30',
|
||||
'FontType' => 'simfang',
|
||||
'FontColor' => '0x000000',
|
||||
'Transparency' => '30',
|
||||
'Text' => '水印内容',
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
|
||||
// 图片水印
|
||||
$result = $cosClient->createMediaWatermarkTemplate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Watermark',
|
||||
'Name' => 'Watermark-Template-Name',
|
||||
'Watermark' => array(
|
||||
'Type' => 'Image',
|
||||
'Pos' => 'TopRight',
|
||||
'LocMode' => 'Absolute',
|
||||
'Dx' => '128',
|
||||
'Dy' => '128',
|
||||
'StartTime' => '',
|
||||
'EndTime' => '',
|
||||
'Image' => array(
|
||||
'Url' => 'https://examplebucket-125000000.cos.ap-guangzhou.myqcloud.com/test01.png',
|
||||
'Mode' => 'Proportion',
|
||||
'Width' => '10',
|
||||
'Height' => '',
|
||||
'Transparency' => '100',
|
||||
'Background' => '',
|
||||
),
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->createMultipartUpload(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
/*
|
||||
'CacheControl' => 'string',
|
||||
'ContentDisposition' => 'string',
|
||||
'ContentEncoding' => 'string',
|
||||
'ContentLanguage' => 'string',
|
||||
'ContentLength' => integer,
|
||||
'ContentType' => 'string',
|
||||
'Expires' => 'string',
|
||||
'Metadata' => array(
|
||||
'string' => 'string',
|
||||
),
|
||||
'StorageClass' => 'string'
|
||||
*/
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucket(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucketCors(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucketDomain(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo "$e\n";
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->DeleteBucketGuetzli(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->DeleteBucketImageStyle(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'StyleName' => 'stylename',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucketLifecycle(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucketTagging(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteBucketWebsite(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo "$e\n";
|
||||
}
|
||||
52
vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php
vendored
Normal file
52
vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//列出所有buckets
|
||||
$buckets = $cosClient->listBuckets();
|
||||
|
||||
//若bucket列表不为空则进行删除逻辑,先删除对象,再判断是否有上传的任务进行删除,最后删除桶
|
||||
if (!empty($buckets['Buckets'][0])) {
|
||||
foreach ($buckets['Buckets'][0]['Bucket'] as $key => $value) {
|
||||
$result = $cosClient->listObjects(array('Bucket' => $value['Name']));
|
||||
if (isset($result['Contents'])) {
|
||||
foreach ($result['Contents'] as $content) {
|
||||
$cosClient->deleteObject(array('Bucket' => $value['Name'], 'Key' => $content['Key']));
|
||||
}
|
||||
}
|
||||
while(True){
|
||||
$result = $cosClient->ListMultipartUploads(
|
||||
array('Bucket' => $value['Name']));
|
||||
if ($result['Uploads'] == array()) {
|
||||
break;
|
||||
}
|
||||
foreach ($result['Uploads'] as $upload) {
|
||||
try {
|
||||
$cosClient->AbortMultipartUpload(
|
||||
array('Bucket' => $value['Name'],
|
||||
'Key' => $upload['Key'],
|
||||
'UploadId' => $upload['UploadId']));
|
||||
} catch (\Exception $e) {
|
||||
print_r($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
$cosClient->deleteBucket(array('Bucket' => $value['Name']));
|
||||
}
|
||||
}
|
||||
print_r('DELETE ALL BUCKETS SUCCEED!');
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
48
vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php
vendored
Normal file
48
vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
|
||||
$cos_path = "cos/folder";
|
||||
$nextMarker = '';
|
||||
$isTruncated = true;
|
||||
while ( $isTruncated ) {
|
||||
try {
|
||||
$result = $cosClient->listObjects(
|
||||
['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Delimiter' => '',
|
||||
'EncodingType' => 'url',
|
||||
'Marker' => $nextMarker,
|
||||
'Prefix' => $cos_path,
|
||||
'MaxKeys' => 1000]
|
||||
);
|
||||
$isTruncated = $result['IsTruncated'];
|
||||
$nextMarker = $result['NextMarker'];
|
||||
foreach ( $result['Contents'] as $content ) {
|
||||
$cos_file_path = $content['Key'];
|
||||
$local_file_path = $content['Key'];
|
||||
// 按照需求自定义拼接下载路径
|
||||
try {
|
||||
$cosClient->deleteObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => $cos_file_path,
|
||||
));
|
||||
echo ( $cos_file_path . "\n" );
|
||||
} catch ( \Exception $e ) {
|
||||
echo( $e );
|
||||
}
|
||||
}
|
||||
} catch ( \Exception $e ) {
|
||||
echo( $e );
|
||||
}
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/deleteObject.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/deleteObject.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->deleteObjectTagging(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/deleteWorkflow.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/53990 删除工作流
|
||||
$result = $cosClient->deleteWorkflow(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // WorkflowId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJob.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/71517 查询存量任务
|
||||
$result = $cosClient->describeInventoryTriggerJob(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // jobId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
34
vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php
vendored
Normal file
34
vendor/qcloud/cos-sdk-v5/sample/describeInventoryTriggerJobs.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/71518 批量拉取存量任务
|
||||
$result = $cosClient->describeInventoryTriggerJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
// 'NextToken' => '',
|
||||
// 'Size' => '',
|
||||
// 'OrderByTime' => '',
|
||||
// 'States' => '',
|
||||
// 'StartCreationTime' => '',
|
||||
// 'EndCreationTime' => '',
|
||||
// 'WorkflowId' => '',
|
||||
// 'JobId' => '',
|
||||
// 'Name' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
26
vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php
vendored
Normal file
26
vendor/qcloud/cos-sdk-v5/sample/describeMediaJob.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 查询指定的任务
|
||||
$result = $cosClient->describeMediaJob(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '', // jobId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/describeMediaJobs.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
/*
|
||||
拉取符合条件的任务, 支持
|
||||
Transcode、Snapshot、Animation、Concat、SmartCover、VideoProcess、VideoMontage、VoiceSeparate、SDRtoHDR、
|
||||
DigitalWatermark、ExtractDigitalWatermark、SuperResolution、VideoTag、PicProcess、Segment
|
||||
*/
|
||||
$result = $cosClient->describeMediaJobs(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => 'Transcode', // 任务 的Tag
|
||||
'QueueId' => 'paaf4fce5521a40888a3034a5dxxxxxxx', // queueId
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
31
vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php
vendored
Normal file
31
vendor/qcloud/cos-sdk-v5/sample/describeMediaTemplates.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 查询模版列表
|
||||
$result = $cosClient->describeMediaTemplates(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Tag' => '', // 模板 Tag:Animation、Snapshot、Watermark、Transcode、Concat、HighSpeedHd、VideoMontage、VoiceSeparate、VideoProcess、PicProcess
|
||||
'Category' => 'Custom',
|
||||
'Ids' => '',
|
||||
'Name' => '',
|
||||
'PageNumber' => '',
|
||||
'PageSize' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
29
vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php
vendored
Normal file
29
vendor/qcloud/cos-sdk-v5/sample/describeWorkflow.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/53991 搜索工作流
|
||||
$result = $cosClient->describeWorkflow(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
// 'Ids' => '',
|
||||
// 'Name' => '',
|
||||
// 'PageNumber' => '',
|
||||
// 'PageSize' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
67
vendor/qcloud/cos-sdk-v5/sample/detectAudio.php
vendored
Normal file
67
vendor/qcloud/cos-sdk-v5/sample/detectAudio.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// start --------------- 桶文件审核 ----------------- //
|
||||
$result = $cosClient->detectAudio(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Object' => 'sound01.mp3',
|
||||
// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
// 'UserInfo' => array(
|
||||
// 'TokenId' => '',
|
||||
// 'Nickname' => '',
|
||||
// 'DeviceId' => '',
|
||||
// 'AppId' => '',
|
||||
// 'Room' => '',
|
||||
// 'IP' => '',
|
||||
// 'Type' => '',
|
||||
// 'ReceiveTokenId' => '',
|
||||
// 'Gender' => '',
|
||||
// 'Level' => '',
|
||||
// 'Role' => '',
|
||||
// ),
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '', // 可选 定制化策略
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略
|
||||
// 'Callback' => '', // 可选 回调URL
|
||||
// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。
|
||||
// ), // 可选 走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 桶文件审核 ----------------- //
|
||||
|
||||
// start --------------- 音频文件地址审核 ----------------- //
|
||||
$result = $cosClient->detectAudio(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => 'https://example.com/test.mp3',
|
||||
// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '', // 可选 定制化策略
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略
|
||||
// 'Callback' => '', // 可选 回调URL
|
||||
// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。
|
||||
// ), // 可选 走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 音频文件地址审核 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
63
vendor/qcloud/cos-sdk-v5/sample/detectDocument.php
vendored
Normal file
63
vendor/qcloud/cos-sdk-v5/sample/detectDocument.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 存储桶文档审核
|
||||
$result = $cosClient->detectDocument(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Object' => 'test01.docx',
|
||||
// 'Type' => 'docx',
|
||||
// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
// 'UserInfo' => array(
|
||||
// 'TokenId' => '',
|
||||
// 'Nickname' => '',
|
||||
// 'DeviceId' => '',
|
||||
// 'AppId' => '',
|
||||
// 'Room' => '',
|
||||
// 'IP' => '',
|
||||
// 'Type' => '',
|
||||
// 'ReceiveTokenId' => '',
|
||||
// 'Gender' => '',
|
||||
// 'Level' => '',
|
||||
// 'Role' => '',
|
||||
// ),
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '',
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
|
||||
// 'Callback' => '', // 回调URL 选填
|
||||
// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
|
||||
// 文档URL审核
|
||||
$result = $cosClient->detectDocument(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => 'https://example.com/test01.docx',
|
||||
// 'Type' => 'docx',
|
||||
// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '',
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
|
||||
// 'Callback' => '', // 回调URL 选填
|
||||
// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
55
vendor/qcloud/cos-sdk-v5/sample/detectImage.php
vendored
Normal file
55
vendor/qcloud/cos-sdk-v5/sample/detectImage.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//存储桶图片审核
|
||||
$result = $cosClient->detectImage(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'test.png', // 桶文件
|
||||
'ci-process' => 'sensitive-content-recognition',
|
||||
// 'BizType' => '', // 可选 定制化策略,不传走默认策略
|
||||
// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格
|
||||
// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
|
||||
// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
|
||||
// 'LargeImageDetect' => '',
|
||||
// 'DataId' => '',
|
||||
// 'Async' => '',
|
||||
// 'Callback' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
|
||||
|
||||
//图片链接审核
|
||||
$imgUrl = 'https://test.jpg';
|
||||
$result = $cosClient->detectImage(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => '/', // 链接图片资源路径写 / 即可
|
||||
'ci-process' => 'sensitive-content-recognition',
|
||||
'DetectUrl' => $imgUrl,
|
||||
// 'BizType' => '', // 可选 定制化策略,不传走默认策略
|
||||
// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格
|
||||
// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
|
||||
// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
|
||||
// 'LargeImageDetect' => '',
|
||||
// 'DataId' => '',
|
||||
// 'Async' => '',
|
||||
// 'Callback' => '',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
56
vendor/qcloud/cos-sdk-v5/sample/detectImages.php
vendored
Normal file
56
vendor/qcloud/cos-sdk-v5/sample/detectImages.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 获取图片base64编码
|
||||
// $localImageFile = '/tmp/test.jpg';
|
||||
// $img = file_get_contents($localImageFile);
|
||||
// $imgInfo = getimagesize($localImageFile);
|
||||
// $imgBase64Content = base64_encode($img);
|
||||
|
||||
$result = $cosClient->detectImages(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Inputs' => array(
|
||||
array(
|
||||
'Object' => 'test01.png', // 桶文件
|
||||
// 'Interval' => '', // 可选 审核 GIF 时使用 截帧的间隔
|
||||
// 'MaxFrames' => '', // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
|
||||
// 'DataId' => 'aaa', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
|
||||
),
|
||||
array(
|
||||
'Url' => 'http://example.com/test.png', // 图片URL
|
||||
// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
|
||||
// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
|
||||
// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
|
||||
),
|
||||
// array(
|
||||
// 'Content' => $imgBase64Content, // 图片文件的内容,需要先经过 base64 编码。
|
||||
//// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
|
||||
//// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
|
||||
//// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
|
||||
// ),
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '', // 可选 定制化策略,不传走默认策略
|
||||
// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 或 定制化策略,四种参数:Porn,Ads等,可使用多种规则,注意规则间不要加空格
|
||||
// 'Async' => 0, // 可选 是否异步进行审核,0:同步返回结果,1:异步进行审核。默认值为 0。
|
||||
// 'Callback' => '', // 可选 审核结果(Detail版本)以回调形式发送至您的回调地址
|
||||
// ) // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/detectLable.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/detectLable.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->DetectLabel(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
43
vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php
vendored
Normal file
43
vendor/qcloud/cos-sdk-v5/sample/detectLiveVideo.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->detectLiveVideo(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Type' => 'live_video',
|
||||
'Input' => array(
|
||||
'Url' => 'rtmp://example.com/live/123', // 直播流地址
|
||||
// 'DataId' => '',
|
||||
// 'UserInfo' => array(
|
||||
// 'TokenId' => '',
|
||||
// 'Nickname' => '',
|
||||
// 'DeviceId' => '',
|
||||
// 'AppId' => '',
|
||||
// 'Room' => '',
|
||||
// 'IP' => '',
|
||||
// 'Type' => '',
|
||||
// ),
|
||||
),
|
||||
'Conf' => array(
|
||||
'Callback' => '',
|
||||
// 'CallbackType' => 1,
|
||||
'BizType' => '07d41bbb5a3a93dca4xxxxxxxxxxx', // 直播流审核 BizType 必填,可联系工作人员生成后使用
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
71
vendor/qcloud/cos-sdk-v5/sample/detectText.php
vendored
Normal file
71
vendor/qcloud/cos-sdk-v5/sample/detectText.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// start --------------- 文本内容审核 ----------------- //
|
||||
$content = '敏感词';
|
||||
$result = $cosClient->detectText(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Content' => base64_encode($content), // 文本需base64_encode
|
||||
// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads,Illegal,Abuse', // 选填,在只有BizType时走设定策略的审核场景
|
||||
// 'BizType' => '',
|
||||
// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 文本内容审核 ----------------- //
|
||||
|
||||
// start --------------- 存储桶文本文件审核 ----------------- //
|
||||
$result = $cosClient->detectText(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Object' => 'test01.txt'
|
||||
// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '',
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
|
||||
// 'Callback' => '', // 回调URL 选填
|
||||
// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple
|
||||
// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 存储桶文本文件审核 ----------------- //
|
||||
|
||||
// start --------------- 文本文件Url审核 ----------------- //
|
||||
$result = $cosClient->detectText(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => 'http://example.com/test.txt'
|
||||
// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
// 'BizType' => '',
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景
|
||||
// 'Callback' => '', // 选填 回调URL
|
||||
// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple
|
||||
// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
// end --------------- 文本文件Url审核 ----------------- //
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
77
vendor/qcloud/cos-sdk-v5/sample/detectVideo.php
vendored
Normal file
77
vendor/qcloud/cos-sdk-v5/sample/detectVideo.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
//存储桶视频审核
|
||||
$result = $cosClient->detectVideo(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Object' => 'test.mp4', // 存储桶文件
|
||||
// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
// 'UserInfo' => array(
|
||||
// 'TokenId' => '',
|
||||
// 'Nickname' => '',
|
||||
// 'DeviceId' => '',
|
||||
// 'AppId' => '',
|
||||
// 'Room' => '',
|
||||
// 'IP' => '',
|
||||
// 'Type' => '',
|
||||
// 'ReceiveTokenId' => '',
|
||||
// 'Gender' => '',
|
||||
// 'Level' => '',
|
||||
// 'Role' => '',
|
||||
// ),
|
||||
),
|
||||
'Conf' => array(
|
||||
// 'BizType' => '', // 可选 定制化策略
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略
|
||||
// 'Callback' => '', // 可选 回调URL
|
||||
// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。
|
||||
// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。
|
||||
'Snapshot' => array(
|
||||
// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。
|
||||
// 'TimeInterval' => 50, // 可选 视频截帧频率
|
||||
'Count' => '3', // 视频截帧数量
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
//视频url审核
|
||||
$videoUrl = 'http://example.com/test.mp4';
|
||||
$result = $cosClient->detectVideo(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => $videoUrl, // 视频url
|
||||
// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
'Conf' => array(
|
||||
// 'BizType' => '', // 可选 定制化策略
|
||||
// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略
|
||||
// 'Callback' => '', // 可选 回调URL
|
||||
// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。
|
||||
// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。
|
||||
'Snapshot' => array(
|
||||
// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。
|
||||
// 'TimeInterval' => 50, // 可选 视频截帧频率
|
||||
'Count' => '3', // 视频截帧数量
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
44
vendor/qcloud/cos-sdk-v5/sample/detectVirus.php
vendored
Normal file
44
vendor/qcloud/cos-sdk-v5/sample/detectVirus.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 存储桶文件查毒
|
||||
$result = $cosClient->detectVirus(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Object' => 'test01.exe'
|
||||
),
|
||||
'Conf' => array(
|
||||
'DetectType' => 'Virus',
|
||||
// 'Callback' => '',
|
||||
),
|
||||
));
|
||||
|
||||
// URL查毒
|
||||
$result = $cosClient->detectVirus(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => 'https://example.com/test01.exe',
|
||||
),
|
||||
'Conf' => array(
|
||||
'DetectType' => 'Virus',
|
||||
// 'Callback' => '',
|
||||
),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
33
vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php
vendored
Normal file
33
vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', // 审核时必须为https
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->detectWebpage(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Input' => array(
|
||||
'Url' => 'https://www.xxx.com/',
|
||||
// 'DataId' => '' // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。
|
||||
),
|
||||
// 'Conf' => array(
|
||||
//// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略
|
||||
//// 'ReturnHighlightHtml' => 'true', // 可选 'true' 或者 'false'
|
||||
//// 'Callback' => '', // 可选
|
||||
// ), // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
64
vendor/qcloud/cos-sdk-v5/sample/document2dstType.php
vendored
Normal file
64
vendor/qcloud/cos-sdk-v5/sample/document2dstType.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 1. 文档转码 https://cloud.tencent.com/document/product/460/47074
|
||||
$bucket = 'examplebucket-125000000';
|
||||
$key = 'exampleobject';
|
||||
$url = $cosClient->getObjectUrl($bucket, $key);
|
||||
$params = array(
|
||||
'ci-process' => 'doc-preview',
|
||||
// 'srcType' => '',
|
||||
'page' => 3,
|
||||
'dstType' => 'png',
|
||||
// 'password' => '',
|
||||
// 'comment' => '',
|
||||
// 'sheet' => '',
|
||||
// 'excelPaperDirection' => '',
|
||||
// 'excelRow' => '',
|
||||
// 'excelCol' => '',
|
||||
// 'excelPaperSize' => '',
|
||||
// 'txtPagination' => '',
|
||||
'ImageParams' => 'imageMogr2/thumbnail/!50p',
|
||||
// 'quality' => '',
|
||||
// 'scale' => '',
|
||||
// 'imageDpi' => '',
|
||||
);
|
||||
$query = http_build_query($params);
|
||||
echo $url . $query; // 生成的可访问链接
|
||||
|
||||
// 2. 文档转HTML https://cloud.tencent.com/document/product/460/52518
|
||||
$bucket = 'examplebucket-125000000';
|
||||
$key = 'exampleobject';
|
||||
$url = $cosClient->getObjectUrl($bucket, $key, "+30 minutes");
|
||||
$params = array(
|
||||
'ci-process' => 'doc-preview',
|
||||
// 'srcType' => '',
|
||||
'dstType' => 'html',
|
||||
// 'sign' => '',
|
||||
// 'copyable' => '',
|
||||
// 'htmlParams' => '',
|
||||
// 'htmlwaterword' => '',
|
||||
// 'htmlfillstyle' => '',
|
||||
// 'htmlfront' => '',
|
||||
// 'htmlrotate' => '',
|
||||
// 'htmlhorizontal' => '',
|
||||
// 'htmlvertical' => '',
|
||||
);
|
||||
$query = http_build_query($params);
|
||||
echo $url . $query; // 生成的可访问链接
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->doesBucketExist(
|
||||
'examplebucket-125000000'//存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
); ;
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->doesObjectExist(
|
||||
'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'exampleobject' //对象名
|
||||
);
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
38
vendor/qcloud/cos-sdk-v5/sample/download.php
vendored
Normal file
38
vendor/qcloud/cos-sdk-v5/sample/download.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
|
||||
$printbar = function($totalSize, $downloadedSize) {
|
||||
printf("downloaded [%d/%d]\n", $downloadedSize, $totalSize);
|
||||
};
|
||||
|
||||
try {
|
||||
$result = $cosClient->download(
|
||||
$bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
$key = 'exampleobject',
|
||||
$saveAs = $local_path,
|
||||
$options=['Progress' => $printbar, //指定进度条
|
||||
'PartSize' => 10 * 1024 * 1024, //分块大小
|
||||
'Concurrency' => 5, //并发数
|
||||
'ResumableDownload' => true, //是否开启断点续传,默认为false
|
||||
'ResumableTaskFile' => 'tmp.cosresumabletask' //断点文件信息路径,默认为<localpath>.cosresumabletask
|
||||
]
|
||||
);
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
52
vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php
vendored
Normal file
52
vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey
|
||||
)
|
||||
)
|
||||
);
|
||||
$cos_path = 'cos/folder';
|
||||
$nextMarker = '';
|
||||
$isTruncated = true;
|
||||
|
||||
while ( $isTruncated ) {
|
||||
try {
|
||||
$result = $cosClient->listObjects(
|
||||
['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Delimiter' => '',
|
||||
'EncodingType' => 'url',
|
||||
'Marker' => $nextMarker,
|
||||
'Prefix' => $cos_path,
|
||||
'MaxKeys' => 1000]
|
||||
);
|
||||
} catch ( \Exception $e ) {
|
||||
echo( $e );
|
||||
}
|
||||
$isTruncated = $result['IsTruncated'];
|
||||
$nextMarker = $result['NextMarker'];
|
||||
foreach ( $result['Contents'] as $content ) {
|
||||
$cos_file_path = $content['Key'];
|
||||
$local_file_path = $content['Key'];
|
||||
// 按照需求自定义拼接下载路径
|
||||
try {
|
||||
$result = $cosClient->download(
|
||||
$bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
$key = $cos_file_path,
|
||||
$saveAs = $local_file_path
|
||||
);
|
||||
echo ( $cos_file_path . "\n" );
|
||||
} catch ( \Exception $e ) {
|
||||
echo( $e );
|
||||
}
|
||||
}
|
||||
}
|
||||
33
vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php
vendored
Normal file
33
vendor/qcloud/cos-sdk-v5/sample/fileJobs4Hash.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// https://cloud.tencent.com/document/product/436/83107 哈希值计算同步请求
|
||||
$result = $cosClient->FileJobs4Hash(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'for-test.mp4', // 桶文件
|
||||
'Type' => 'md5', // 支持的哈希算法类型,有效值:md5、sha1、sha256
|
||||
// 'AddToHeader' => 'true', // 是否将计算得到的哈希值,自动添加至文件的自定义header,格式为:x-cos-meta-md5/sha1/sha256; 有效值: true、false,不填则默认为false。
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
/**
|
||||
* 可能出现的 Exception
|
||||
* 1. Error Message: file processing is not active yet, please apply for file processing service first
|
||||
* 解决方式:开通文件处理服务
|
||||
*/
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getActionSequence.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials' => array(
|
||||
'secretId' => $secretId,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
// 获取动作顺序 https://cloud.tencent.com/document/product/460/48648
|
||||
$result = $cosClient->getActionSequence(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
35
vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php
vendored
Normal file
35
vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
$local_path = "/data/exampleobject";
|
||||
try {
|
||||
$blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate();
|
||||
$blindWatermarkTemplate->setPick();
|
||||
$blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg");
|
||||
$blindWatermarkTemplate->setType(2);
|
||||
$picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation();
|
||||
$picOperationsTemplate->setIsPicInfo(1);
|
||||
$picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject");
|
||||
$result = $cosClient->putObject(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Key' => 'exampleobject',
|
||||
'Body' => fopen($local_path, 'rb'),
|
||||
'PicOperations' => $picOperationsTemplate->queryString(),
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketAccelerate(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketAcl(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketCors(array(
|
||||
'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketDomain(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo "$e\n";
|
||||
}
|
||||
24
vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php
vendored
Normal file
24
vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->GetBucketGuetzli(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->GetBucketImageStyle(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'StyleName' => 'stylename',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
25
vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php
vendored
Normal file
25
vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__, 2) . '/vendor/autoload.php';
|
||||
|
||||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
|
||||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
|
||||
$cosClient = new Qcloud\Cos\Client(
|
||||
array(
|
||||
'region' => $region,
|
||||
'schema' => 'https', //协议头部,默认为http
|
||||
'credentials'=> array(
|
||||
'secretId' => $secretId ,
|
||||
'secretKey' => $secretKey)));
|
||||
try {
|
||||
$result = $cosClient->getBucketInvnetory(array(
|
||||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
|
||||
'Id' => 'string',
|
||||
));
|
||||
// 请求成功
|
||||
print_r($result);
|
||||
} catch (\Exception $e) {
|
||||
// 请求失败
|
||||
echo($e);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user