Przeglądaj źródła

add tencent-php use to cos-object

wang jun 3 lat temu
rodzic
commit
3d1359ce35
100 zmienionych plików z 4312 dodań i 0 usunięć
  1. 0 0
      extend/.gitignore_1
  2. BIN
      extend/tencent-php/._CHANGELOG.md
  3. BIN
      extend/tencent-php/._index.php
  4. 6 0
      extend/tencent-php/.gitattributes
  5. 10 0
      extend/tencent-php/.gitignore
  6. 20 0
      extend/tencent-php/.travis.yml
  7. 298 0
      extend/tencent-php/CHANGELOG.md
  8. 21 0
      extend/tencent-php/LICENSE
  9. 302 0
      extend/tencent-php/README.md
  10. 60 0
      extend/tencent-php/bin/format
  11. 85 0
      extend/tencent-php/bin/release
  12. 56 0
      extend/tencent-php/composer.json
  13. 16 0
      extend/tencent-php/phpunit.xml
  14. 26 0
      extend/tencent-php/sample/abortMultipartUpload.php
  15. 36 0
      extend/tencent-php/sample/appendObject.php
  16. 31 0
      extend/tencent-php/sample/blindWatermark.php
  17. 25 0
      extend/tencent-php/sample/cancelLiveVideoAuditing.php
  18. 29 0
      extend/tencent-php/sample/catchException.php
  19. 38 0
      extend/tencent-php/sample/ciTransformation.php
  20. 36 0
      extend/tencent-php/sample/completeMultipartUpload.php
  21. 31 0
      extend/tencent-php/sample/copy.php
  22. 27 0
      extend/tencent-php/sample/copyObject.php
  23. 30 0
      extend/tencent-php/sample/cosClient.php
  24. 24 0
      extend/tencent-php/sample/createBucket.php
  25. 49 0
      extend/tencent-php/sample/createDocProcessJobs.php
  26. 26 0
      extend/tencent-php/sample/createFolder.php
  27. 81 0
      extend/tencent-php/sample/createMediaAnimationJobs.php
  28. 96 0
      extend/tencent-php/sample/createMediaConcatJobs.php
  29. 43 0
      extend/tencent-php/sample/createMediaDigitalWatermarkJobs.php
  30. 37 0
      extend/tencent-php/sample/createMediaExtractDigitalWatermarkJobs.php
  31. 56 0
      extend/tencent-php/sample/createMediaJobs.php
  32. 67 0
      extend/tencent-php/sample/createMediaPicProcessJobs.php
  33. 43 0
      extend/tencent-php/sample/createMediaSDRtoHDRJobs.php
  34. 46 0
      extend/tencent-php/sample/createMediaSegmentJobs.php
  35. 38 0
      extend/tencent-php/sample/createMediaSmartCoverJobs.php
  36. 71 0
      extend/tencent-php/sample/createMediaSnapshotJobs.php
  37. 157 0
      extend/tencent-php/sample/createMediaSuperResolutionJobs.php
  38. 120 0
      extend/tencent-php/sample/createMediaTranscodeJobs.php
  39. 83 0
      extend/tencent-php/sample/createMediaVideoMontageJobs.php
  40. 153 0
      extend/tencent-php/sample/createMediaVideoProcessJobs.php
  41. 36 0
      extend/tencent-php/sample/createMediaVideoTagJobs.php
  42. 73 0
      extend/tencent-php/sample/createMediaVoiceSeparateJobs.php
  43. 38 0
      extend/tencent-php/sample/createMultipartUpload.php
  44. 24 0
      extend/tencent-php/sample/deleteBucket.php
  45. 24 0
      extend/tencent-php/sample/deleteBucketCors.php
  46. 24 0
      extend/tencent-php/sample/deleteBucketDomain.php
  47. 24 0
      extend/tencent-php/sample/deleteBucketGuetzli.php
  48. 24 0
      extend/tencent-php/sample/deleteBucketImageStyle.php
  49. 24 0
      extend/tencent-php/sample/deleteBucketLifecycle.php
  50. 24 0
      extend/tencent-php/sample/deleteBucketTagging.php
  51. 24 0
      extend/tencent-php/sample/deleteBucketWebsite.php
  52. 52 0
      extend/tencent-php/sample/deleteBuckets.php
  53. 48 0
      extend/tencent-php/sample/deleteFolder.php
  54. 25 0
      extend/tencent-php/sample/deleteObject.php
  55. 25 0
      extend/tencent-php/sample/deleteObjectTagging.php
  56. 26 0
      extend/tencent-php/sample/describeMediaJob.php
  57. 31 0
      extend/tencent-php/sample/describeMediaJobs.php
  58. 54 0
      extend/tencent-php/sample/detectAudio.php
  59. 50 0
      extend/tencent-php/sample/detectDocument.php
  60. 47 0
      extend/tencent-php/sample/detectImage.php
  61. 42 0
      extend/tencent-php/sample/detectImages.php
  62. 25 0
      extend/tencent-php/sample/detectLable.php
  63. 43 0
      extend/tencent-php/sample/detectLiveVideo.php
  64. 71 0
      extend/tencent-php/sample/detectText.php
  65. 64 0
      extend/tencent-php/sample/detectVideo.php
  66. 44 0
      extend/tencent-php/sample/detectVirus.php
  67. 33 0
      extend/tencent-php/sample/detectWebpage.php
  68. 24 0
      extend/tencent-php/sample/doesBucketExist.php
  69. 25 0
      extend/tencent-php/sample/doesObjectExist.php
  70. 38 0
      extend/tencent-php/sample/download.php
  71. 52 0
      extend/tencent-php/sample/downloadFolder.php
  72. 35 0
      extend/tencent-php/sample/getBlindWatermark.php
  73. 24 0
      extend/tencent-php/sample/getBucketAccelerate.php
  74. 24 0
      extend/tencent-php/sample/getBucketAcl.php
  75. 24 0
      extend/tencent-php/sample/getBucketCors.php
  76. 24 0
      extend/tencent-php/sample/getBucketDomain.php
  77. 24 0
      extend/tencent-php/sample/getBucketGuetzli.php
  78. 25 0
      extend/tencent-php/sample/getBucketImageStyle.php
  79. 25 0
      extend/tencent-php/sample/getBucketInventory.php
  80. 24 0
      extend/tencent-php/sample/getBucketLifecycle.php
  81. 24 0
      extend/tencent-php/sample/getBucketLogging.php
  82. 25 0
      extend/tencent-php/sample/getBucketReferer.php
  83. 24 0
      extend/tencent-php/sample/getBucketTagging.php
  84. 24 0
      extend/tencent-php/sample/getBucketWebsite.php
  85. 25 0
      extend/tencent-php/sample/getDescribeDocProcessJob.php
  86. 32 0
      extend/tencent-php/sample/getDescribeDocProcessJobs.php
  87. 24 0
      extend/tencent-php/sample/getDescribeDocProcessQueues.php
  88. 29 0
      extend/tencent-php/sample/getDescribeMediaBuckets.php
  89. 29 0
      extend/tencent-php/sample/getDescribeMediaQueues.php
  90. 25 0
      extend/tencent-php/sample/getDescribeMediaVoiceSeparateJob.php
  91. 25 0
      extend/tencent-php/sample/getDetectAudioResult.php
  92. 25 0
      extend/tencent-php/sample/getDetectDocumentResult.php
  93. 25 0
      extend/tencent-php/sample/getDetectImageResult.php
  94. 25 0
      extend/tencent-php/sample/getDetectTextResult.php
  95. 25 0
      extend/tencent-php/sample/getDetectVideoResult.php
  96. 25 0
      extend/tencent-php/sample/getDetectVirusResult.php
  97. 25 0
      extend/tencent-php/sample/getDetectWebpageResult.php
  98. 29 0
      extend/tencent-php/sample/getMediaInfo.php
  99. 35 0
      extend/tencent-php/sample/getObject.php
  100. 52 0
      extend/tencent-php/sample/getObjectSensitiveContentRecognition.php

+ 0 - 0
extend/.gitignore → extend/.gitignore_1


BIN
extend/tencent-php/._CHANGELOG.md


BIN
extend/tencent-php/._index.php


+ 6 - 0
extend/tencent-php/.gitattributes

@@ -0,0 +1,6 @@
+/.gitattributes       export-ignore
+/.gitignore           export-ignore
+/.travis.yml          export-ignore
+/phpunit.xml          export-ignore
+/bin                  export-ignore
+/tests                export-ignore

+ 10 - 0
extend/tencent-php/.gitignore

@@ -0,0 +1,10 @@
+.vscode/
+.idea/
+composer.lock
+vendor/
+*.DS_Store
+index.php
+coverage.xml
+.phpunit.result.cache
+local_test_file
+test_tmp_file

+ 20 - 0
extend/tencent-php/.travis.yml

@@ -0,0 +1,20 @@
+language: php
+php:
+  - 7.3
+notifications:
+  email:
+    recipients:
+      - tuunalai@tencent.com
+
+env:
+  global:
+    - XDEBUG_MODE=coverage
+
+before_script:
+  - composer install --no-interaction
+
+script:
+  - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpunit -v; fi'
+
+after_success:
+  - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash <(curl -s https://codecov.io/bash); fi'

+ 298 - 0
extend/tencent-php/CHANGELOG.md

@@ -0,0 +1,298 @@
+cos-php-sdk-v5 Upgrade Guide
+====================
+2.5.5 to 2.5.6
+---------
+- 创建SDRtoHDR任务	
+- 创建添加数字水印任务	
+- 创建提取数字水印任务	
+- 创建超分任务	
+- 创建视频标签	
+- 创建图片处理任务	
+- 创建转封装任务	
+- 审核各接口参数修改
+- 直播流审核接口
+- 取消直播流审核接口
+- 修复全球加速region不存在的问题
+
+2.5.4 to 2.5.5
+---------
+- fix signHost type error
+
+2.5.3 to 2.5.4
+---------
+- 新增查询是否开通媒体处理接口
+- 新增获取pm3u8签名接口
+- 新增查询队列列表接口
+- 新增更新队列接口
+- 新增查询任务接口
+- 新增创建多任务接口
+- 新增创建截图任务接口
+- 新增创建转码任务接口
+- 新增创建动图任务接口
+- 新增创建拼接任务接口
+- 新增创建智能封面任务接口
+- 新增创建视频增强任务接口
+- 新增创建精彩集锦任务接口
+- 新增创建人声分离任务接口
+- 修复signHost值获取不到的问题
+
+2.5.2 to 2.5.3
+---------
+- 增加ETag的兼容逻辑,防止因为特殊框架或者网关规则导致etag undefined
+
+2.5.1 to 2.5.2
+---------
+- 修复预签名中Headers参数无效的问题
+
+2.5.0 to 2.5.1
+---------
+- 万象相关接口的DetectType审核类型参数可选
+- 万象内容审核接口增加DataId自定义业务标识
+- 新增万象网页审核任务相关接口
+- 新增部分参数校验
+- 修复PHP8.1中将null传递给不可为空的内部函数的问题
+
+2.4.4 to 2.5.0
+---------
+- 万象支持病毒检测、人声分离任务接口
+- 万象转码任务支持多个水印参数/多任务接口/查询接口/列表接口
+- 修复签名长期存在的bug
+- 修复copy接口404问题,copyObject示例添加注释
+- 审核接口增加仅支持https的说明
+
+2.4.3 to 2.4.4
+---------
+- 修复图片水印签名问题
+
+2.4.2 to 2.4.3
+---------
+- 优化审核接口返回相关字段
+- 增加host开关功能
+- GetObject接口支持万象自定义样式
+- 修复ip的host bug
+
+2.4.1 to 2.4.2
+---------
+- 修复图片处理相关接口403签名不对的bug
+
+2.4.0 to 2.4.1
+---------
+- 增加桶Bucket、GetBucket对应Sample详细注解
+- 对部分传入参数进行检查
+- 添加doesObjectExist、doesBucketExist对应Sample
+- 调整整体项目架构,修复composer依赖问题
+- 调整UT
+
+2.3.4 to 2.4.0
+---------
+- 新增文档转码功能,包括提交、查询、拉取文档预览任务
+- 丰富头域参数说明
+- 修复预签名中将万象参数作为key报错问题
+- 调整travis与action,后续版本保证多版本测试正常
+
+2.3.3 to 2.3.4
+---------
+- 修复laravel8中guzzlehttp/psr7报错问题,后续重新整理依赖
+- 修复putBucketAccelerate接口与目前API不一致的问题
+
+2.3.2 to 2.3.3
+---------
+- 修复laravel8中guzzlehttp/psr7报错问题
+- 清理无用代码
+
+2.3.1 to 2.3.2
+---------
+- 新增视频截帧,视频信息查询示例
+- 新增PUT/GET Bucket Referer示例
+- 对于相应接口添加CRC返回信息
+- 修复图片审核中ci-process param出现两次的问题
+- 修复PHP5.6 版本的依赖问题
+- 根据PHP版本自动composer install guzzle6.x或guzzle7
+
+2.3.0 to 2.3.1
+---------
+- 修复文本检测的返回格式
+- 修复sample中的问题
+- 新增视频、文本、文档、音频检测
+- 新增媒体转码、截图、拼接
+
+2.2.3 to 2.3.0
+---------
+- 新增图片审核,视频审核,音频审核,文本审核,文档审核接口
+- 新增单链接限速demo
+- 暴露getPresigned接口Headers和Params参数接口
+- 补充textDetect UT
+- 修复stream_for废弃问题
+- 修复x-cos头检测逻辑问题
+- 修复UT部分bug
+
+2.2.2 to 2.2.3
+- 在putObejct中新增x-cos-tagging头
+- 修复`GetObjectWithoutSign`bug
+
+2.2.1 to 2.2.2
+----------
+新增appendObject SDK,包括sample,service,test
+增加无签名对象下载地址 SDK,包括sample,service,test
+增加全球加速相关配置参数
+将COS_SECRETID修改为SECRETID、COS_SECRETKEY修改为SECRETKEY,防止混淆
+修复部分逻辑代码bug
+修复部分拼写错误
+- Add `AppendObject` interface
+- Add `GetObjectWithoutSign` interface
+- Add `allow_accelerate` param to client
+- Change const name `COS_SECRETID->SECRETID` `COS_SECRETKEY->SECRETKEY`
+- Fix `getPresigned` interface
+- Fix typo
+
+2.2.0 to 2.2.1
+----------
+- Add `PutObjectTagging` interface
+- Add `GetObjectTagging` interface
+- Add `DeleteObjectTagging` interface
+
+2.1.6 to 2.2.0
+----------
+- `PutObject` interface supports ci image process
+- `GetObject` interface supports ci image process
+- Add `ImageInfo` interface, which is used for get image info
+- Add `ImageExif` interface, which is used for get image exif
+- Add `ImageAve` interface, which is used for get image ave
+- Add `ImageProcess` interface, which is used for data processing on cloud
+- Add `Qrcode` interface, which is used for qrcode recognition
+- Add `QrcodeGenerate` interface, which is used for generate qrcode
+- Add `DetectLabel` interface, which is used for detect image label
+- Add `PutBucketImageStyle` interface, which is used for add bucket image style
+- Add `GetBucketImageStyle` interface, which is used for get bucket image style
+- Add `DeleteBucketImageStyle` interface, which is used for delete bucket image style
+- Add `PutBucketGuetzli` interface, which is used for open bucket guetzli state
+- Add `GetBucketGuetzli` interface, which is used for get bucket guetzli state
+- Add `DeleteBucketGuetzli` interface, which is used for close bucket guetzli state
+
+2.1.5 to 2.1.6
+----------
+- Add `allow_redirects` parameter
+- Fix `selectObjectContent` interface
+
+2.1.3 to 2.1.5
+----------
+- The `download` interface supports breakpoint
+- Rename `getPresignetUrl` to `getPresignedUrl`
+
+2.1.2 to 2.1.3
+----------
+- Add `download` interface, which is used for concurrent block download
+- Add callback of `upload` and `download` progress
+- Fix request retry
+
+2.1.1 to 2.1.2
+----------
+- The interface supports custom parameters
+- Fix `ListBucketInventoryConfigurations`
+
+2.1.0 to 2.1.1
+----------
+- Fix bug of urlencode when calculating signature
+
+2.0.9 to 2.1.0
+----------
+- `upload` support upload with multithread
+- Add `retry` params for interface retry
+- Support add customer header
+- Signature will restrict part of the header and all parameters
+- Fix `listBuckets` with `doamin`
+
+2.0.8 to 2.0.9
+----------
+- Fix bug of `listObjectVersions`
+- Update `getObject` with param of `saveas`
+
+2.0.7 to 2.0.8
+----------
+- Fix presigned url when using tmpSecretId/tmpSecretKey/Token
+
+2.0.6 to 2.0.7
+----------
+- Fix response of `ListParts`
+
+2.0.5 to 2.0.6
+----------
+- Support Domain
+- Add Select Object Content Interface
+- Add Traffic Limit
+- Fix bug of object endswith /
+
+2.0.4 to 2.0.5
+----------
+- Fix bug when upload object with metadata
+
+2.0.3 to 2.0.4
+----------
+- Fix bug when using ip-port
+
+2.0.2 to 2.0.3
+----------
+- Fix path parse bug with /0/
+
+2.0.1 to 2.0.2
+----------
+- Fix bug of `putObject` with `fopen`
+- Add ut
+
+
+2.0.0 to 2.0.1
+----------
+- Add interface of inventory/tagging/logging
+- Fix bug of some interface with query string
+
+
+1.3 to 2.0
+----------
+cos-php-sdk-v5 now uses [GuzzleHttp] for HTTP message.
+Due to fact, it depending on PHP >= 5.6.
+
+- Use the `Qcloud\Cos\Client\getPresignetUrl()` method instead of the `Qcloud\Cos\Command\createPresignedUrl()`
+
+v2:
+```php
+$signedUrl = $cosClient->getPresignetUrl($method='putObject',
+                                         $args=['Bucket'=>'examplebucket-1250000000', 'Key'=>'exampleobject', 'Body'=>''],
+                                         $expires='+30 minutes');
+```
+
+v1:
+```php
+$command = $cosClient->getCommand('putObject', array(
+    'Bucket' => "examplebucket-1250000000",
+    'Key' => "exampleobject",
+    'Body' => '', 
+));
+$signedUrl = $command->createPresignedUrl('+30 minutes');
+```
+
+- `$copSource` parameters of the `Qcloud\Cos\Client\Copy` interface are no longer compatible with older versions.
+
+v2:
+
+```php
+$result = $cosClient->copy( 
+    $bucket = '<srcBucket>', 
+    $Key = '<srcKey>', 
+    $copySorce = array(
+        'Region' => '<sourceRegion>', 
+        'Bucket' => '<sourceBucket>', 
+        'Key' => '<sourceKey>', 
+    )
+);
+```
+
+v1:
+```php
+$result = $cosClient->Copy(
+    $bucket = '<srcBucket>',
+    $key = '<srcKey>', 
+    $copysource = '<sourceBucket>.cos.<sourceRegion>.myqcloud.com/<sourceKey>'
+);
+```
+- Now when uploading files with using `open()` to upload stream, if the local file does not exist, a 0 byte file will be uploaded without throwing an exception, only a warning.
+

+ 21 - 0
extend/tencent-php/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 腾讯云
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 302 - 0
extend/tencent-php/README.md

@@ -0,0 +1,302 @@
+# COS-PHP-SDK-V5
+
+腾讯云 COS-PHP-SDK-V5([XML API](https://cloud.tencent.com/document/product/436/7751))
+
+[![PHP Version](http://poser.pugx.org/qcloud/cos-sdk-v5/require/php)](https://packagist.org/packages/qcloud/cos-sdk-v5)
+[![License](https://poser.pugx.org/qcloud/cos-sdk-v5/license)](LICENSE)
+[![Latest Stable Version](https://poser.pugx.org/qcloud/cos-sdk-v5/v/stable)](https://packagist.org/packages/qcloud/cos-sdk-v5)
+[![Total Downloads](https://img.shields.io/packagist/dt/qcloud/cos-sdk-v5.svg?style=flat)](https://packagist.org/packages/qcloud/cos-sdk-v5)
+[![Build Status](https://api.travis-ci.com/tencentyun/cos-php-sdk-v5.svg?branch=master)](https://app.travis-ci.com/github/tencentyun/cos-php-sdk-v5)
+[![codecov](https://codecov.io/gh/tencentyun/cos-php-sdk-v5/branch/master/graph/badge.svg)](https://codecov.io/gh/tencentyun/cos-php-sdk-v5)
+[![Support Multiple Versions](https://github.com/tencentyun/cos-php-sdk-v5/actions/workflows/install.yml/badge.svg)](https://github.com/tencentyun/cos-php-sdk-v5/actions/workflows/install.yml)
+
+## 依赖
+
+- [x] PHP >= 5.6
+> 如果您的 php 版本 `>=5.3` 且 `<5.6` , 请使用 [v1.3](https://github.com/tencentyun/cos-php-sdk-v5/tree/1.3) 版本
+
+- [x] ext-curl
+- [x] ext-json
+- [x] ext-simplexml
+
+## 安装
+
+SDK 安装有三种方式:
+
+- [Composer 方式](#composer-方式)
+- [Phar 方式](#Phar-方式)
+- [源码方式](#源码方式)
+
+### Composer 方式
+
+推荐使用 Composer 安装 cos-php-sdk-v5,Composer 是 PHP 的依赖管理工具,允许您声明项目所需的依赖,然后自动将它们安装到您的项目中。
+
+```bash
+composer require qcloud/cos-sdk-v5
+```
+
+> 您可以在 [Composer 官网](https://getcomposer.org/) 上找到更多关于如何安装 Composer,配置自动加载以及用于定义依赖项的其他最佳实践等相关信息。
+
+#### 安装步骤
+
+1. 打开终端;
+2. 下载 Composer,执行以下命令:
+
+```bash
+curl -sS https://getcomposer.org/installer | php
+```
+
+3. 创建一个名为`composer.json`的文件,内容如下:
+
+```json
+{
+    "require": {
+        "qcloud/cos-sdk-v5": "2.*"
+    }
+}
+```
+
+4. 使用 Composer 安装,执行以下命令:
+
+```bash
+php composer.phar install
+```
+
+使用该命令后会在当前目录中创建一个 vendor 文件夹,里面包含 SDK 的依赖库和一个 autoload.php 脚本,方便在项目中调用。
+
+5. 通过 autoload.php 脚本调用 cos-php-sdk-v5:
+
+```php
+require '/path/to/vendor/autoload.php';
+```
+
+现在您的项目已经可以使用 COS 的 V5 版本 SDK 了。
+
+### Phar 方式
+
+Phar 方式安装 SDK 的步骤如下:
+
+1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 phar 文件;
+> 对于 PHP 版本`>= 5.6`且`<7.2.5`的用户请下载`cos-sdk-v5-6.phar`以使用 Guzzle6 版本。  
+> 对于 PHP 版本`>=7.2.5`的用户请下载`cos-sdk-v5-7.phar`以使用 Guzzle7 版本。
+2. 在代码中引入 phar 文件:
+
+```php
+require '/path/to/cos-sdk-v5.phar';
+```
+
+### 源码方式
+
+源码方式安装 SDK 的步骤如下:
+
+1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 cos-sdk-v5.tar.gz 文件;
+> 对于 PHP 版本`>= 5.6`且`<7.2.5`的用户请下载`cos-sdk-v5-6.tar.gz`以使用 Guzzle6 版本。  
+> 对于 PHP 版本`>=7.2.5`的用户请下载`cos-sdk-v5-7.tar.gz`以使用 Guzzle7 版本。
+2. 解压后通过 autoload.php 脚本加载 SDK:
+
+```php
+require '/path/to/cos-sdk-v5/vendor/autoload.php';
+```
+
+## 快速入门
+
+可参照 Demo 程序,详见 [sample 目录](https://github.com/tencentyun/cos-php-sdk-v5/tree/master/sample) 。
+
+## 接口文档
+
+PHP SDK 接口文档,详见 [https://cloud.tencent.com/document/product/436/12267](https://cloud.tencent.com/document/product/436/12267)
+
+### 配置文件
+
+```php
+$cosClient = new Qcloud\Cos\Client(array(
+    'region' => '<Region>',
+    'credentials' => array(
+        'secretId' => '<SecretId>',
+        'secretKey' => '<SecretKey>'
+    )
+));
+```
+
+若您使用 [临时密钥](https://cloud.tencent.com/document/product/436/14048) 初始化,请用下面方式创建实例。
+
+```php
+$cosClient = new Qcloud\Cos\Client(array(
+    'region' => '<Region>',
+    'credentials' => array(
+        'secretId' => '<SecretId>',
+        'secretKey' => '<SecretKey>',
+        'token' => '<XCosSecurityToken>'
+    )
+));
+```
+
+### 上传文件
+
+- 使用 putObject 接口上传文件(最大 5G)
+- 使用 Upload 接口分块上传文件
+
+```php
+# 上传文件
+## putObject(上传接口,最大支持上传5G文件)
+### 上传内存中的字符串
+//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => 'Hello World!'));
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 上传文件流
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => fopen($local_path, 'rb')));
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 设置header和meta
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => fopen($local_path, 'rb'),
+        'ACL' => 'string',
+        'CacheControl' => 'string',
+        'ContentDisposition' => 'string',
+        'ContentEncoding' => 'string',
+        'ContentLanguage' => 'string',
+        'ContentLength' => integer,
+        'ContentType' => 'string',
+        'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
+        'Metadata' => array(
+            'string' => 'string',
+        ),
+        'StorageClass' => 'string'));
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+## Upload(高级上传接口,默认使用分块上传最大支持50T)
+### 上传内存中的字符串
+try {
+    $result = $cosClient->Upload(
+        $bucket = $bucket,
+        $key = $key,
+        $body = 'Hello World!');
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 上传文件流
+try {
+    $result = $cosClient->Upload(
+        $bucket = $bucket,
+        $key = $key,
+        $body = fopen($local_path, 'rb'));
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 设置header和meta
+try {
+    $result = $cosClient->Upload(
+        $bucket= $bucket,
+        $key = $key,
+        $body = fopen($local_path, 'rb'),
+        $options = array(
+            'ACL' => 'string',
+            'CacheControl' => 'string',
+            'ContentDisposition' => 'string',
+            'ContentEncoding' => 'string',
+            'ContentLanguage' => 'string',
+            'ContentLength' => integer,
+            'ContentType' => 'string',
+            'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
+            'Metadata' => array(
+                'string' => 'string',
+            ),
+            'StorageClass' => 'string'));
+    print_r($result);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+```
+
+### 下载文件
+
+- 使用 getObject 接口下载文件
+- 使用 getObjectUrl 接口获取文件下载 URL
+
+```php
+# 下载文件
+## getObject(下载文件)
+### 下载到内存
+//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key));
+    echo($result['Body']);
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 下载到本地
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'SaveAs' => $local_path));
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 指定下载范围
+/*
+ * Range 字段格式为 'bytes=a-b'
+ */
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Range' => 'bytes=0-10',
+        'SaveAs' => $local_path));
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+### 设置返回header
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'ResponseCacheControl' => 'string',
+        'ResponseContentDisposition' => 'string',
+        'ResponseContentEncoding' => 'string',
+        'ResponseContentLanguage' => 'string',
+        'ResponseContentType' => 'string',
+        'ResponseExpires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
+        'SaveAs' => $local_path));
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+
+## getObjectUrl(获取文件Url)
+try {
+    $signedUrl = $cosClient->getObjectUrl($bucket, $key, '+10 minutes');
+    echo $signedUrl;
+} catch (\Exception $e) {
+    echo "$e\n";
+}
+```

+ 60 - 0
extend/tencent-php/bin/format

@@ -0,0 +1,60 @@
+#!/usr/bin/env php
+<?php
+/**
+ * User: sy-records
+ * Email: lufei@php.net
+ * Usage: php bin/format
+ */
+
+function scan_dir(string $dir, callable $filter = null): array
+{
+    $files = array_filter(scandir($dir), function (string $file) {
+        return $file[0] !== '.';
+    });
+    array_walk($files, function (&$file) use ($dir) {
+        $file = "{$dir}/{$file}";
+    });
+    return array_values($filter ? array_filter($files, $filter) : $files);
+}
+
+function fix_tests_in_this_dir(string $dir, string $root = '')
+{
+    $files = scan_dir($dir);
+    foreach ($files as $file) {
+        if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
+            $requirement_level = (function () use ($root, $file) {
+                for ($l = 0; $l < 8; $l++) {
+                    $file = dirname($file);
+                    if ($file === $root) {
+                        return $l;
+                    }
+                }
+                return -1;
+            })();
+            if ($requirement_level < 0) {
+                echo("Failed to get requirement level of file {$file}");
+            }
+            $content = file_get_contents($file);
+            $changed = false;
+            // empty lines
+            $_content = trim($content) . "\n";
+            if ($content !== $_content) {
+                echo "Format empty lines in {$file}", PHP_EOL;
+                $content = $_content;
+                $changed = true;
+            }
+            if ($changed) {
+                file_put_contents($file, $content);
+            }
+        } elseif (is_dir($file)) {
+            fix_tests_in_this_dir($file, $root);
+        }
+    }
+}
+
+$root = realpath(dirname(__DIR__));
+$dirs = ['src', 'tests', 'sample'];
+foreach ($dirs as $dir) {
+    fix_tests_in_this_dir($root . '/' . $dir, $root);
+}
+echo 'Format done', PHP_EOL;

+ 85 - 0
extend/tencent-php/bin/release

@@ -0,0 +1,85 @@
+#!/usr/bin/env php
+<?php
+/**
+ * User: sy-records
+ * Email: lufei@php.net
+ * Usage: php bin/release or php bin/release version
+ */
+
+require_once 'vendor/autoload.php';
+
+use Qcloud\Cos\Client;
+use Qcloud\Cos\Service;
+use GuzzleHttp\Command\Guzzle\Description;
+
+$class = new ReflectionClass(Client::class);
+$oldDocComment = $class->getDocComment();
+$clientFile = $class->getFileName();
+$clientFileContent = file_get_contents($class->getFileName());
+
+$des = new Description(Service::getService());
+$operations = array_keys($des->getOperations());
+$docComment = "/**\n";
+$token = genToken();
+foreach ($operations as $key => $operation) {
+    $type = $arg = $methodDesc = '';
+    $model = $des->getOperation($operation)->getResponseModel();
+    if ($des->hasModel($model)) {
+        $type = $des->getModel($model)->getType();
+        if (!empty($des->getOperation($operation)->getParams())) {
+            $arg = '(array $args)';
+        }
+        $methodDesc = '';
+        if (isset($token['method'][$operation])) {
+            $line = $token['method'][$operation];
+            if (isset($token['comment'][$line])) {
+                $methodDesc = $token['comment'][$line];
+            } elseif (isset($token['comment'][$line - 1])) {
+                $methodDesc = $token['comment'][$line - 1];
+            }
+        }
+    }
+    $docComment .= " * @method {$type} {$operation}{$arg} {$methodDesc}\n";
+}
+$docComment .= " * @see \Qcloud\Cos\Service::getService()\n";
+$docComment .= ' */';
+
+$data = str_replace($oldDocComment, $docComment, $clientFileContent);
+$status = file_put_contents($clientFile, $data);
+
+if ($status) {
+    echo 'Regenerate docComment successfully.', PHP_EOL;
+}
+
+if (isset($argv[1])) {
+    $version = $argv[1];
+    $versionContent = str_replace(Client::VERSION, $version, $data);
+    $status = file_put_contents($clientFile, $versionContent);
+
+    if ($status) {
+        echo 'Update version successfully.', PHP_EOL;
+    }
+}
+
+function genToken()
+{
+    $result = [];
+    $token = token_get_all(file_get_contents(dirname(__DIR__) . '/src/Service.php'));
+    foreach ($token as $value) {
+        if (!is_array($value) || !in_array($value[0], [T_COMMENT, T_CONSTANT_ENCAPSED_STRING])) {
+            continue;
+        }
+        switch ($value[0]) {
+            case T_COMMENT:
+                $result['comment'][$value[2]] = trim(ltrim($value[1], '//'));
+                break;
+            case T_CONSTANT_ENCAPSED_STRING:
+                $key = trim($value[1], "'");
+                if(!isset($result['method'][$key])) {
+                    $result['method'][$key] = $value[2];
+                }
+                break;
+        }
+    }
+    return $result;
+}

+ 56 - 0
extend/tencent-php/composer.json

@@ -0,0 +1,56 @@
+{
+    "name": "qcloud/cos-sdk-v5",
+    "description": "PHP SDK for QCloud COS",
+    "keywords": [
+        "qcloud", "cos", "php"
+    ],
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "yaozongyou",
+            "email": "yaozongyou@vip.qq.com"
+        },
+        {
+            "name": "lewzylu",
+            "email": "327874225@qq.com"
+        },
+        {
+            "name": "tuunalai",
+            "email": "550566181@qq.com"
+        }
+    ],
+    "autoload": {
+        "psr-4": {
+            "Qcloud\\Cos\\": "src/"
+        },
+        "files": ["src/Common.php"]
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "Qcloud\\Cos\\Tests\\": "tests/"
+        }
+    },
+    "require": {
+        "php": ">=5.6",
+        "ext-curl": "*",
+        "ext-json": "*",
+        "ext-simplexml": "*",
+        "guzzlehttp/guzzle": "^6.2.1 || ^7.0",
+        "guzzlehttp/guzzle-services": "^1.1",
+        "guzzlehttp/psr7": "^1.3.1 || ^2.0"
+    },
+    "config": {
+        "optimize-autoloader": true
+    },
+    "scripts": {
+        "test": [
+            "@putenv XDEBUG_MODE=coverage",
+            "phpunit -v --color=always"
+        ]
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "2.4-dev"
+        }
+    }
+}

+ 16 - 0
extend/tencent-php/phpunit.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+  <filter>
+    <whitelist>
+      <directory suffix=".php">./src</directory>
+    </whitelist>
+  </filter>
+  <logging>
+     <log type="coverage-clover" target="coverage.xml" />
+  </logging>
+  <testsuites>
+     <testsuite name="CosTest">
+       <directory>./tests</directory>
+     </testsuite>
+  </testsuites>
+</phpunit>

+ 26 - 0
extend/tencent-php/sample/abortMultipartUpload.php

@@ -0,0 +1,26 @@
+<?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 {
+    $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);
+}

+ 36 - 0
extend/tencent-php/sample/appendObject.php

@@ -0,0 +1,36 @@
+<?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)));
+$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);
+}

+ 31 - 0
extend/tencent-php/sample/blindWatermark.php

@@ -0,0 +1,31 @@
+<?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 {
+    $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);
+}

+ 25 - 0
extend/tencent-php/sample/cancelLiveVideoAuditing.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为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 - 0
extend/tencent-php/sample/catchException.php

@@ -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 {
+    $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 - 0
extend/tencent-php/sample/ciTransformation.php

@@ -0,0 +1,38 @@
+<?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 {
+    $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);
+}

+ 36 - 0
extend/tencent-php/sample/completeMultipartUpload.php

@@ -0,0 +1,36 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/copy.php

@@ -0,0 +1,31 @@
+<?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)));
+$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 - 0
extend/tencent-php/sample/copyObject.php

@@ -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 {
+    $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 - 0
extend/tencent-php/sample/cosClient.php

@@ -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
+$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 - 0
extend/tencent-php/sample/createBucket.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/createDocProcessJobs.php

@@ -0,0 +1,49 @@
+<?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 {
+    $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);
+}

+ 26 - 0
extend/tencent-php/sample/createFolder.php

@@ -0,0 +1,26 @@
+<?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 {
+    $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);
+}

+ 81 - 0
extend/tencent-php/sample/createMediaAnimationJobs.php

@@ -0,0 +1,81 @@
+<?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/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',
+            ),
+        ),
+        '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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 96 - 0
extend/tencent-php/sample/createMediaConcatJobs.php

@@ -0,0 +1,96 @@
+<?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/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',
+            ),
+        ),
+    ));
+    // 请求成功
+    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(
+            '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);
+}

+ 43 - 0
extend/tencent-php/sample/createMediaDigitalWatermarkJobs.php

@@ -0,0 +1,43 @@
+<?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/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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 37 - 0
extend/tencent-php/sample/createMediaExtractDigitalWatermarkJobs.php

@@ -0,0 +1,37 @@
+<?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/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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 56 - 0
extend/tencent-php/sample/createMediaJobs.php

@@ -0,0 +1,56 @@
+<?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/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);
+}

+ 67 - 0
extend/tencent-php/sample/createMediaPicProcessJobs.php

@@ -0,0 +1,67 @@
+<?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/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',
+            ),
+        ),
+        '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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 43 - 0
extend/tencent-php/sample/createMediaSDRtoHDRJobs.php

@@ -0,0 +1,43 @@
+<?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 {
+    // 提交 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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 46 - 0
extend/tencent-php/sample/createMediaSegmentJobs.php

@@ -0,0 +1,46 @@
+<?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/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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 38 - 0
extend/tencent-php/sample/createMediaSmartCoverJobs.php

@@ -0,0 +1,38 @@
+<?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/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(
+            'Output' => array(
+                'Region' => $region,
+                'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+                'Object' => 'SmartCover-${Number}.jpg',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 71 - 0
extend/tencent-php/sample/createMediaSnapshotJobs.php

@@ -0,0 +1,71 @@
+<?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/436/54005
+    // 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',
+            ),
+        ),
+    ));
+    // 请求成功
+    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' => '',
+            ),
+        ),
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 157 - 0
extend/tencent-php/sample/createMediaSuperResolutionJobs.php

@@ -0,0 +1,157 @@
+<?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/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',
+            ),
+        ),
+        '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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 120 - 0
extend/tencent-php/sample/createMediaTranscodeJobs.php

@@ -0,0 +1,120 @@
+<?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/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',
+            '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(
+            '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);
+}

+ 83 - 0
extend/tencent-php/sample/createMediaVideoMontageJobs.php

@@ -0,0 +1,83 @@
+<?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/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',
+            ),
+        ),
+        '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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 153 - 0
extend/tencent-php/sample/createMediaVideoProcessJobs.php

@@ -0,0 +1,153 @@
+<?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/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',
+            ),
+        ),
+        '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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 36 - 0
extend/tencent-php/sample/createMediaVideoTagJobs.php

@@ -0,0 +1,36 @@
+<?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/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',
+            ),
+        ),
+        'CallBack' => '',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 73 - 0
extend/tencent-php/sample/createMediaVoiceSeparateJobs.php

@@ -0,0 +1,73 @@
+<?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/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',
+            ),
+        ),
+    ));
+    // 请求成功
+    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',
+                ),
+            ),
+        ),
+    ));
+    // 请求成功
+    print_r($result);
+    // end --------------- 自定义参数 ----------------- //
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 38 - 0
extend/tencent-php/sample/createMultipartUpload.php

@@ -0,0 +1,38 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteBucket.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteBucketCors.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteBucketDomain.php

@@ -0,0 +1,24 @@
+<?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 { 
+    $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 - 0
extend/tencent-php/sample/deleteBucketGuetzli.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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);
+}

+ 24 - 0
extend/tencent-php/sample/deleteBucketImageStyle.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->DeleteBucketImageStyle(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 24 - 0
extend/tencent-php/sample/deleteBucketLifecycle.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteBucketTagging.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteBucketWebsite.php

@@ -0,0 +1,24 @@
+<?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 { 
+    $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 - 0
extend/tencent-php/sample/deleteBuckets.php

@@ -0,0 +1,52 @@
+<?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 {
+    //列出所有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 - 0
extend/tencent-php/sample/deleteFolder.php

@@ -0,0 +1,48 @@
+<?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)));
+
+$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 - 0
extend/tencent-php/sample/deleteObject.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/deleteObjectTagging.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/describeMediaJob.php

@@ -0,0 +1,26 @@
+<?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 {
+    // 查询指定的任务
+    $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 - 0
extend/tencent-php/sample/describeMediaJobs.php

@@ -0,0 +1,31 @@
+<?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 {
+    /*
+    拉取符合条件的任务, 支持
+    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);
+}

+ 54 - 0
extend/tencent-php/sample/detectAudio.php

@@ -0,0 +1,54 @@
+<?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', // 审核时必须为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字节。您可以使用该字段对待审核的数据进行唯一业务标识。
+        ),
+//        '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);
+}

+ 50 - 0
extend/tencent-php/sample/detectDocument.php

@@ -0,0 +1,50 @@
+<?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', // 审核时必须为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字节。您可以使用该字段对待审核的数据进行唯一业务标识。
+        ),
+//        '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);
+}

+ 47 - 0
extend/tencent-php/sample/detectImage.php

@@ -0,0 +1,47 @@
+<?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', // 审核时必须为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。
+    ));
+    // 请求成功
+    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。
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 42 - 0
extend/tencent-php/sample/detectImages.php

@@ -0,0 +1,42 @@
+<?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', // 审核时必须为https
+        'credentials' => array(
+            'secretId' => $secretId,
+            'secretKey' => $secretKey)));
+try {
+    $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字节
+            ),
+        ),
+//        'Conf' => array(
+//            'BizType' => '' // 可选 定制化策略,不传走默认策略
+//            'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 或 定制化策略,四种参数:Porn,Ads等,可使用多种规则,注意规则间不要加空格
+//        ) // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/detectLable.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/detectLiveVideo.php

@@ -0,0 +1,43 @@
+<?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', // 审核时必须为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 - 0
extend/tencent-php/sample/detectText.php

@@ -0,0 +1,71 @@
+<?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', // 审核时必须为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);
+}

+ 64 - 0
extend/tencent-php/sample/detectVideo.php

@@ -0,0 +1,64 @@
+<?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', // 审核时必须为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字节。您可以使用该字段对待审核的数据进行唯一业务标识。
+        ),
+        '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 - 0
extend/tencent-php/sample/detectVirus.php

@@ -0,0 +1,44 @@
+<?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', // 审核时必须为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 - 0
extend/tencent-php/sample/detectWebpage.php

@@ -0,0 +1,33 @@
+<?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', // 审核时必须为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);
+}

+ 24 - 0
extend/tencent-php/sample/doesBucketExist.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->doesBucketExist(
+        'examplebucket-125000000'//存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ); ;
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/doesObjectExist.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/download.php

@@ -0,0 +1,38 @@
+<?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)));
+$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 - 0
extend/tencent-php/sample/downloadFolder.php

@@ -0,0 +1,52 @@
+<?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
+        )
+    )
+);
+$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 );
+        }
+    }
+}

+ 35 - 0
extend/tencent-php/sample/getBlindWatermark.php

@@ -0,0 +1,35 @@
+<?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)));
+$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 - 0
extend/tencent-php/sample/getBucketAccelerate.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/getBucketAcl.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/getBucketCors.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/getBucketDomain.php

@@ -0,0 +1,24 @@
+<?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 { 
+    $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 - 0
extend/tencent-php/sample/getBucketGuetzli.php

@@ -0,0 +1,24 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/getBucketImageStyle.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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 - 0
extend/tencent-php/sample/getBucketInventory.php

@@ -0,0 +1,25 @@
+<?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 {
+    $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);
+}

+ 24 - 0
extend/tencent-php/sample/getBucketLifecycle.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->getBucketLifecycle(array(
+        'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 24 - 0
extend/tencent-php/sample/getBucketLogging.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->getBucketLogging(array(
+        'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/getBucketReferer.php

@@ -0,0 +1,25 @@
+<?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 {
+    $result = $cosClient->getBucketReferer(array(
+            'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        )
+    );
+    // 请求成功
+    echo($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 24 - 0
extend/tencent-php/sample/getBucketTagging.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->getBucketTagging(array(
+        'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 24 - 0
extend/tencent-php/sample/getBucketWebsite.php

@@ -0,0 +1,24 @@
+<?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 { 
+    $result = $cosClient->getBucketWebsite(array( 
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket 
+    ));
+    // 请求成功 
+    print_r($result); 
+} catch (\Exception $e) { 
+    // 请求失败 
+    echo "$e\n"; 
+}

+ 25 - 0
extend/tencent-php/sample/getDescribeDocProcessJob.php

@@ -0,0 +1,25 @@
+<?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 {
+    $result = $cosClient->describeDocProcessJob(array(
+        'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => 'examplejobid', // JobId
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 32 - 0
extend/tencent-php/sample/getDescribeDocProcessJobs.php

@@ -0,0 +1,32 @@
+<?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 {
+    $result = $cosClient->getDescribeDocProcessJobs(array(
+        'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //拉取该队列 ID 下的任务
+        'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值
+//      'NextToken' => '143486', //请求的上下文,用于翻页。上次返回的值
+//      'OrderByTime' => 'Desc', //Desc 或者 Asc。默认为 Desc
+//      'Size' => 2, //拉取的最大任务数。默认为10。最大为100
+//      'States' => 'All', //拉取该状态的任务,以,分割,支持多状态:All、Submitted、Running、Success、Failed、Pause、Cancel。默认为 All。
+//      'StartCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间大于该时间的任务
+//      'EndCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间小于该时间的任务
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 24 - 0
extend/tencent-php/sample/getDescribeDocProcessQueues.php

@@ -0,0 +1,24 @@
+<?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 {
+    $result = $cosClient->describeDocProcessQueues(array(
+        'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 29 - 0
extend/tencent-php/sample/getDescribeMediaBuckets.php

@@ -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 {
+    $result = $cosClient->describeMediaBuckets(array(
+        'Regions' => '', // 可选 地域信息,例如 ap-shanghai、ap-beijing,若查询多个地域以“,”分隔字符串
+        'BucketNames' => '', // 可选 存储桶名称,以“,”分隔,支持多个存储桶,精确搜索
+        'BucketName' => '', // 可选 存储桶名称前缀,前缀搜索
+        'PageNumber' => 1, // 可选 第几页
+        'PageSize' => 20, // 可选 每页个数
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 29 - 0
extend/tencent-php/sample/getDescribeMediaQueues.php

@@ -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 {
+    $result = $cosClient->describeMediaQueues(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'QueueIds' => '', // 可选 队列 ID,以“,”符号分割字符串
+        'State' => 'Paused', // 可选 1. Active 表示队列内的作业会被媒体转码服务调度转码执行 2. Paused 表示队列暂停,作业不再会被媒体转码调度转码执行,队列内的所有作业状态维持在暂停状态,已经处于转码中的任务将继续转码,不受影响
+        'PageNumber' => '1', // 可选 第几页
+        'PageSize' => '2', // 可选 每页个数
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/getDescribeMediaVoiceSeparateJob.php

@@ -0,0 +1,25 @@
+<?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 {
+    $result = $cosClient->describeMediaVoiceSeparateJob(array(
+        'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => 'examplejobid', // JobId
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/getDetectAudioResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectAudioResult(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 - 0
extend/tencent-php/sample/getDetectDocumentResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectDocumentResult(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 - 0
extend/tencent-php/sample/getDetectImageResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectImageResult(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => 'exampleobject', // jobId
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 25 - 0
extend/tencent-php/sample/getDetectTextResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectTextResult(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 - 0
extend/tencent-php/sample/getDetectVideoResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectVideoResult(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 - 0
extend/tencent-php/sample/getDetectVirusResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectVirusResult(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 - 0
extend/tencent-php/sample/getDetectWebpageResult.php

@@ -0,0 +1,25 @@
+<?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', // 审核时必须为https
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->getDetectWebpageResult(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 - 0
extend/tencent-php/sample/getMediaInfo.php

@@ -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 {
+    $result = $cosClient->GetMediaInfo(
+        array(
+            'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+            'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4
+            'ci-process' => 'videoinfo' //操作类型,固定使用 videoinfo
+        )
+    );
+    // 请求成功
+    echo($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 35 - 0
extend/tencent-php/sample/getObject.php

@@ -0,0 +1,35 @@
+<?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 {
+    $result = $cosClient->getObject(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => 'exampleobject',
+        'SaveAs' => '/data/exampleobject',
+        /*
+        'Range' => 'bytes=0-10',
+        'ResponseCacheControl' => 'string',
+        'ResponseContentDisposition' => 'string',
+        'ResponseContentEncoding' => 'string',
+        'ResponseContentLanguage' => 'string',
+        'ResponseContentType' => 'string',
+        'ResponseExpires' => 'string',
+        */
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

+ 52 - 0
extend/tencent-php/sample/getObjectSensitiveContentRecognition.php

@@ -0,0 +1,52 @@
+<?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 {
+    /**
+     * 此接口已不再维护 2021.11.25
+     * 图片审核建议使用 detectImage & detectImages 两个接口
+     * 新增功能字段会在 detectImage & detectImages 接口维护
+     */
+    //存储桶图片审核
+    $result = $cosClient->getObjectSensitiveContentRecognition(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => 'exampleobject',
+        'DetectType' => 'porn,politics', //可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格
+        'ci-process' => 'sensitive-content-recognition',
+//      'Interval' => 5, // 审核gif时使用 截帧的间隔
+//      'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。
+//      'BizType' => '', // 审核策略
+    ));
+    // 请求成功
+    print_r($result);
+
+
+    //图片链接审核
+    $imgUrl = 'https://test.jpg';
+    $result = $cosClient->getObjectSensitiveContentRecognition(array(
+        'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
+        'Key' => '/', // 链接图片资源路径写 / 即可
+        'DetectType' => 'porn,ads',//可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格
+        'DetectUrl' => $imgUrl,
+        'ci-process' => 'sensitive-content-recognition',
+//      'Interval' => 5, // 审核gif时使用 截帧的间隔
+//      'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。
+//      'BizType' => '', // 审核策略
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików