hrjy 2 years ago
parent
commit
11558763c8
100 changed files with 10510 additions and 0 deletions
  1. 8 0
      vendor/psr/simple-cache/README.md
  2. 10 0
      vendor/psr/simple-cache/src/CacheException.php
  3. 114 0
      vendor/psr/simple-cache/src/CacheInterface.php
  4. 13 0
      vendor/psr/simple-cache/src/InvalidArgumentException.php
  5. 2 0
      vendor/qcloud/cos-sdk-v5/.gitignore
  6. 6 0
      vendor/qcloud/cos-sdk-v5/.travis.yml
  7. 21 0
      vendor/qcloud/cos-sdk-v5/LICENSE
  8. 264 0
      vendor/qcloud/cos-sdk-v5/README.md
  9. 27 0
      vendor/qcloud/cos-sdk-v5/composer.json
  10. 7 0
      vendor/qcloud/cos-sdk-v5/phpunit.xml
  11. 824 0
      vendor/qcloud/cos-sdk-v5/sample.php
  12. 27 0
      vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php
  13. 30 0
      vendor/qcloud/cos-sdk-v5/sample/catchException.php
  14. 37 0
      vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php
  15. 28 0
      vendor/qcloud/cos-sdk-v5/sample/copyObject.php
  16. 25 0
      vendor/qcloud/cos-sdk-v5/sample/createBucket.php
  17. 39 0
      vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php
  18. 25 0
      vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php
  19. 25 0
      vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php
  20. 25 0
      vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php
  21. 26 0
      vendor/qcloud/cos-sdk-v5/sample/deleteObject.php
  22. 25 0
      vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php
  23. 25 0
      vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php
  24. 25 0
      vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php
  25. 36 0
      vendor/qcloud/cos-sdk-v5/sample/getObject.php
  26. 25 0
      vendor/qcloud/cos-sdk-v5/sample/headBucket.php
  27. 26 0
      vendor/qcloud/cos-sdk-v5/sample/headObject.php
  28. 24 0
      vendor/qcloud/cos-sdk-v5/sample/listBucket.php
  29. 31 0
      vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php
  30. 30 0
      vendor/qcloud/cos-sdk-v5/sample/listObjects.php
  31. 29 0
      vendor/qcloud/cos-sdk-v5/sample/listParts.php
  32. 41 0
      vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php
  33. 33 0
      vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php
  34. 35 0
      vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php
  35. 41 0
      vendor/qcloud/cos-sdk-v5/sample/putObject.php
  36. 30 0
      vendor/qcloud/cos-sdk-v5/sample/restoreObject.php
  37. 49 0
      vendor/qcloud/cos-sdk-v5/sample/upload.php
  38. 31 0
      vendor/qcloud/cos-sdk-v5/sample/uploadPart.php
  39. 107 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/BucketStyleListener.php
  40. 250 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Client.php
  41. 39 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Command.php
  42. 140 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Copy.php
  43. 5 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/BucketAlreadyExistsException.php
  44. 6 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/BucketNotEmptyException.php
  45. 7 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/CosException.php
  46. 5 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/CurlException.php
  47. 5 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/InvalidArgumentException.php
  48. 6 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchBucketException.php
  49. 6 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchKeyException.php
  50. 8 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchUploadException.php
  51. 189 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/ServiceResponseException.php
  52. 69 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/ExceptionListener.php
  53. 109 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/ExceptionParser.php
  54. 57 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Md5Listener.php
  55. 132 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/MultipartUpload.php
  56. 4360 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Service.php
  57. 50 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Signature.php
  58. 45 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/SignatureListener.php
  59. 1347 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Tests/Test.php
  60. 48 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Tests/TestHelper.php
  61. 48 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/TokenListener.php
  62. 79 0
      vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/UploadBodyListener.php
  63. 12 0
      vendor/qiniu/php-sdk/.gitignore
  64. 35 0
      vendor/qiniu/php-sdk/.scrutinizer.yml
  65. 28 0
      vendor/qiniu/php-sdk/.travis.yml
  66. 105 0
      vendor/qiniu/php-sdk/CHANGELOG.md
  67. 30 0
      vendor/qiniu/php-sdk/CONTRIBUTING.md
  68. 22 0
      vendor/qiniu/php-sdk/LICENSE
  69. 75 0
      vendor/qiniu/php-sdk/README.md
  70. 14 0
      vendor/qiniu/php-sdk/autoload.php
  71. 26 0
      vendor/qiniu/php-sdk/composer.json
  72. 71 0
      vendor/qiniu/php-sdk/docs/rtc/README.md
  73. 42 0
      vendor/qiniu/php-sdk/docs/rtc/example.php
  74. 70 0
      vendor/qiniu/php-sdk/docs/sms/example.php
  75. 10 0
      vendor/qiniu/php-sdk/examples/README.md
  76. 30 0
      vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php
  77. 40 0
      vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php
  78. 34 0
      vendor/qiniu/php-sdk/examples/cdn_get_flux.php
  79. 29 0
      vendor/qiniu/php-sdk/examples/cdn_get_log_list.php
  80. 52 0
      vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php
  81. 19 0
      vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php
  82. 20 0
      vendor/qiniu/php-sdk/examples/delete_bucket.php
  83. 21 0
      vendor/qiniu/php-sdk/examples/delete_bucketEvent.php
  84. 21 0
      vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php
  85. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketEvents.php
  86. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php
  87. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketList.php
  88. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketQuota.php
  89. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketinfo.php
  90. 20 0
      vendor/qiniu/php-sdk/examples/get_bucketinfos.php
  91. 20 0
      vendor/qiniu/php-sdk/examples/get_corsRules.php
  92. 74 0
      vendor/qiniu/php-sdk/examples/image_url_builder.php
  93. 19 0
      vendor/qiniu/php-sdk/examples/persistent_fop_init.php
  94. 18 0
      vendor/qiniu/php-sdk/examples/persistent_fop_status.php
  95. 43 0
      vendor/qiniu/php-sdk/examples/pfop_mkzip.php
  96. 46 0
      vendor/qiniu/php-sdk/examples/pfop_vframe.php
  97. 47 0
      vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php
  98. 52 0
      vendor/qiniu/php-sdk/examples/pfop_watermark.php
  99. BIN
      vendor/qiniu/php-sdk/examples/php-logo.png
  100. 29 0
      vendor/qiniu/php-sdk/examples/prefop.php

+ 8 - 0
vendor/psr/simple-cache/README.md

@@ -0,0 +1,8 @@
+PHP FIG Simple Cache PSR
+========================
+
+This repository holds all interfaces related to PSR-16.
+
+Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details.
+
+You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package.

+ 10 - 0
vendor/psr/simple-cache/src/CacheException.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace Psr\SimpleCache;
+
+/**
+ * Interface used for all types of exceptions thrown by the implementing library.
+ */
+interface CacheException
+{
+}

+ 114 - 0
vendor/psr/simple-cache/src/CacheInterface.php

@@ -0,0 +1,114 @@
+<?php
+
+namespace Psr\SimpleCache;
+
+interface CacheInterface
+{
+    /**
+     * Fetches a value from the cache.
+     *
+     * @param string $key     The unique key of this item in the cache.
+     * @param mixed  $default Default value to return if the key does not exist.
+     *
+     * @return mixed The value of the item from the cache, or $default in case of cache miss.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if the $key string is not a legal value.
+     */
+    public function get($key, $default = null);
+
+    /**
+     * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
+     *
+     * @param string                 $key   The key of the item to store.
+     * @param mixed                  $value The value of the item to store, must be serializable.
+     * @param null|int|\DateInterval $ttl   Optional. The TTL value of this item. If no value is sent and
+     *                                      the driver supports TTL then the library may set a default value
+     *                                      for it or let the driver take care of that.
+     *
+     * @return bool True on success and false on failure.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if the $key string is not a legal value.
+     */
+    public function set($key, $value, $ttl = null);
+
+    /**
+     * Delete an item from the cache by its unique key.
+     *
+     * @param string $key The unique cache key of the item to delete.
+     *
+     * @return bool True if the item was successfully removed. False if there was an error.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if the $key string is not a legal value.
+     */
+    public function delete($key);
+
+    /**
+     * Wipes clean the entire cache's keys.
+     *
+     * @return bool True on success and false on failure.
+     */
+    public function clear();
+
+    /**
+     * Obtains multiple cache items by their unique keys.
+     *
+     * @param iterable $keys    A list of keys that can obtained in a single operation.
+     * @param mixed    $default Default value to return for keys that do not exist.
+     *
+     * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if $keys is neither an array nor a Traversable,
+     *   or if any of the $keys are not a legal value.
+     */
+    public function getMultiple($keys, $default = null);
+
+    /**
+     * Persists a set of key => value pairs in the cache, with an optional TTL.
+     *
+     * @param iterable               $values A list of key => value pairs for a multiple-set operation.
+     * @param null|int|\DateInterval $ttl    Optional. The TTL value of this item. If no value is sent and
+     *                                       the driver supports TTL then the library may set a default value
+     *                                       for it or let the driver take care of that.
+     *
+     * @return bool True on success and false on failure.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if $values is neither an array nor a Traversable,
+     *   or if any of the $values are not a legal value.
+     */
+    public function setMultiple($values, $ttl = null);
+
+    /**
+     * Deletes multiple cache items in a single operation.
+     *
+     * @param iterable $keys A list of string-based keys to be deleted.
+     *
+     * @return bool True if the items were successfully removed. False if there was an error.
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if $keys is neither an array nor a Traversable,
+     *   or if any of the $keys are not a legal value.
+     */
+    public function deleteMultiple($keys);
+
+    /**
+     * Determines whether an item is present in the cache.
+     *
+     * NOTE: It is recommended that has() is only to be used for cache warming type purposes
+     * and not to be used within your live applications operations for get/set, as this method
+     * is subject to a race condition where your has() will return true and immediately after,
+     * another script can remove it making the state of your app out of date.
+     *
+     * @param string $key The cache item key.
+     *
+     * @return bool
+     *
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     *   MUST be thrown if the $key string is not a legal value.
+     */
+    public function has($key);
+}

+ 13 - 0
vendor/psr/simple-cache/src/InvalidArgumentException.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace Psr\SimpleCache;
+
+/**
+ * Exception interface for invalid cache arguments.
+ *
+ * When an invalid argument is passed it must throw an exception which implements
+ * this interface
+ */
+interface InvalidArgumentException extends CacheException
+{
+}

+ 2 - 0
vendor/qcloud/cos-sdk-v5/.gitignore

@@ -0,0 +1,2 @@
+.vscode/
+.idea/

+ 6 - 0
vendor/qcloud/cos-sdk-v5/.travis.yml

@@ -0,0 +1,6 @@
+language: php
+php:
+  - 5.6
+script: 
+  - composer install
+  - phpunit -v

+ 21 - 0
vendor/qcloud/cos-sdk-v5/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.

+ 264 - 0
vendor/qcloud/cos-sdk-v5/README.md

@@ -0,0 +1,264 @@
+# COS-PHP-SDK-V5
+腾讯云COS-PHP-SDK-V5([XML API](https://cloud.tencent.com/document/product/436/7751))
+
+[![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://travis-ci.org/tencentyun/cos-php-sdk-v5.svg?branch=master)](https://travis-ci.org/tencentyun/cos-php-sdk-v5)
+
+## 环境准备
+*   PHP 5.3+
+    您可以通过`php -v`命令查看当前的 PHP 版本。
+*   cURL 扩展
+    您可以通过`php -m`命令查看 cURL 扩展是否已经安装好。
+
+>- Ubuntu 系统中,您可以使用 apt-get 包管理器安装 PHP 的 cURL 扩展,安装命令如下。
+```
+sudo apt-get install php-curl
+```
+>- CentOS 系统中,您可以使用 yum 包管理器安装 PHP 的 cURL 扩展。
+```
+sudo yum install php-curl
+```
+
+## SDK 安装
+SDK 安装有三种方式:
+* Composer 方式
+* Phar 方式
+* 源码方式
+
+### Composer 方式
+推荐使用 Composer 安装 cos-php-sdk-v5,Composer 是 PHP 的依赖管理工具,允许您声明项目所需的依赖,然后自动将它们安装到您的项目中。
+> 您可以在 [Composer 官网](https://getcomposer.org/) 上找到更多关于如何安装 Composer,配置自动加载以及用于定义依赖项的其他最佳实践等相关信息。
+
+#### 安装步骤: 
+1. 打开终端。
+2. 下载 Composer,执行以下命令。
+```
+curl -sS https://getcomposer.org/installer | php
+```
+3. 创建一个名为`composer.json`的文件,内容如下。
+```
+{
+    "require": {
+        "qcloud/cos-sdk-v5": "1.*"
+    }
+}
+```
+4. 使用 Composer 安装,执行以下命令。
+```
+php composer.phar install
+```
+使用该命令后会在当前目录中创建一个 vendor 文件夹,里面包含 SDK 的依赖库和一个 autoload.php 脚本,方便在项目中调用。
+5. 通过 autoloader 脚本调用 cos-php-sdk-v5。
+```
+require '/path/to/sdk/vendor/autoload.php';
+```
+
+现在您的项目已经可以使用 COS 的 V5 版本 SDK 了。
+
+### Phar 方式
+Phar 方式安装 SDK 的步骤如下:
+1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 phar 文件。
+2.  在代码中引入 phar 文件:
+```
+require  '/path/to/cos-sdk-v5.phar';
+```
+
+### 源码方式
+源码方式安装 SDK 的步骤如下:
+1.  在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 zip 文件。
+2.  解压通过 autoload.php 脚本加载 SDK:
+```
+require '/path/to/sdk/vendor/autoload.php';
+```
+
+## 快速入门 
+可参照 Demo 程序,详见 [sample.php](https://github.com/tencentyun/cos-php-sdk-v5/blob/master/sample.php)。
+
+## 接口文档
+php sdk 接口文档,详见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) 初始化,请用下面方式创建实例。
+
+```
+$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) {
+    print_r($e);
+}
+```
+

+ 27 - 0
vendor/qcloud/cos-sdk-v5/composer.json

@@ -0,0 +1,27 @@
+{
+    "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"
+        }
+    ],
+    "autoload": {
+      "psr-0": {
+        "Qcloud\\Cos\\": "src/"
+     }
+    },
+    "require": {
+        "php": ">=5.3.0",
+        "guzzle/guzzle": "~3.7"
+    }
+}

+ 7 - 0
vendor/qcloud/cos-sdk-v5/phpunit.xml

@@ -0,0 +1,7 @@
+<phpunit bootstrap="vendor/autoload.php">
+  <testsuites>
+    <testsuite name="cos">
+      <directory>src/Qcloud/Cos/Tests</directory>
+    </testsuite>
+  </testsuites>
+</phpunit>

+ 824 - 0
vendor/qcloud/cos-sdk-v5/sample.php

@@ -0,0 +1,824 @@
+<?php
+
+require 'vendor/autoload.php';
+
+$cosClient = new Qcloud\Cos\Client(array(
+    'region' => 'COS_REGION', #地域,如ap-guangzhou,ap-beijing-1
+    'credentials' => array(
+        'secretId' => 'COS_KEY',
+        'secretKey' => 'COS_SECRET',
+    ),
+));
+
+// 若初始化 Client 时未填写 appId,则 bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
+$bucket = 'test2-1252448703';
+$key = 'a.txt';
+$local_path = "E:/a.txt";
+
+# 上传文件
+## putObject(上传接口,最大支持上传5G文件)
+### 上传内存中的字符串
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => 'Hello World!'
+    ));
+    print_r($result);
+    # 可以直接通过$result读出返回结果
+    echo ($result['ETag']);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 上传文件流
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => fopen($local_path, 'rb')
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 设置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',
+        'GrantFullControl' => 'string',
+        'GrantRead' => 'string',
+        'GrantWrite' => 'string',
+        'Metadata' => array(
+            'string' => 'string',
+        ),
+        'StorageClass' => 'string'
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## Upload(高级上传接口,默认使用分块上传最大支持50T)
+### 上传内存中的字符串
+try {
+    $result = $cosClient->upload(
+        $bucket = $bucket,
+        $key = $key,
+        $body = 'Hello World!'
+    );
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 上传文件流
+try {
+    $result = $cosClient->upload(
+        $bucket = $bucket,
+        $key = $key,
+        $body = fopen($local_path, 'rb')
+    );
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 设置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',
+            'GrantFullControl' => 'string',
+            'GrantRead' => 'string',
+            'GrantWrite' => 'string',
+            'Metadata' => array(
+                'string' => 'string',
+            ),
+            'StorageClass' => 'string'
+        )
+    );
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## 预签名上传createPresignedUrl
+## 获取带有签名的url
+### 简单上传预签名
+try {
+    #此处可以替换为其他上传接口
+    $command = $cosClient->getCommand('putObject', array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => '', //Body可以任意
+    ));
+    $signedUrl = $command->createPresignedUrl('+10 minutes');
+    echo ($signedUrl);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 分块上传预签名
+try {
+    #此处可以替换为其他上传接口
+    $command = $cosClient->getCommand('uploadPart', array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'UploadId' => '',
+        'PartNumber' => '1',
+        'Body' => '', //Body可以任意
+    ));
+    $signedUrl = $command->createPresignedUrl('+10 minutes');
+    echo ($signedUrl);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 获取签名
+try {
+    #此处可以替换为其他上传接口
+    $command = $cosClient->getCommand('putObject', array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Body' => '', //Body可以任意
+    ));
+    $signedUrl = $command->createAuthorization('+10 minutes');
+    echo ($signedUrl);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+
+# 下载文件
+## getObject(下载文件)
+### 下载到内存
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key
+    ));
+    echo $result['Body'];
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 下载到本地
+try {
+    $result = $cosClient->getObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'SaveAs' => $local_path
+    ));
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 指定下载范围
+/*
+ * 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);
+}
+
+### 设置返回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);
+}
+
+## getObjectUrl(获取文件UrL)
+try {
+    $signedUrl = $cosClient->getObjectUrl($bucket, $key, '+10 minutes');
+    echo $signedUrl;
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 删除object
+## deleteObject
+try {
+    $result = $cosClient->deleteObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'VersionId' => 'string'
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 删除多个object
+## deleteObjects
+try {
+    $result = $cosClient->deleteObjects(array(
+        'Bucket' => 'string',
+        'Objects' => array(
+            array(
+                'Key' => $key,
+                'VersionId' => 'string',
+            ),
+            // ... repeated
+        ),
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 获取object信息
+## headObject
+/*
+ * 可代替isObjectExist接口,查询object是否存在
+ */
+try {
+    $result = $cosClient->headObject(array(
+        'Bucket' => $bucket,
+        'Key' => '11',
+        'VersionId' => '111',
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 获取bucket列表
+## listBuckets
+try {
+    $result = $cosClient->listBuckets();
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 创建bucket
+## createBucket
+try {
+    $result = $cosClient->createBucket(array('Bucket' => $bucket));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 删除bucket
+## deleteBucket
+try {
+    $result = $cosClient->deleteBucket(array(
+        'Bucket' => $bucket
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 获取bucket信息
+## headBucket
+/*
+ * 可代替isBucketExist接口,查询bucket是否存在
+ */
+try {
+    $result = $cosClient->headBucket(array(
+        'Bucket' => $bucket
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 列出bucket下的object
+## listObjects
+### 列出所有object
+/*
+ * 该接口一次最多列出1000个,需要列出所有请参考其他服务中的清空并删除bucket接口
+ */
+try {
+    $result = $cosClient->listObjects(array(
+        'Bucket' => $bucket
+    ));
+    foreach ($result['Contents'] as $rt) {
+        print_r($rt);
+    }
+} catch (\Exception $e) {
+    echo($e);
+}
+
+### 列出带有前缀的object
+try {
+    $result = $cosClient->listObjects(array(
+        'Bucket' => $bucket,
+        'Prefix' => 'string'
+    ));
+    foreach ($result['Contents'] as $rt) {
+        print_r($rt);
+    }
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 获取bucket地域
+## getBucketLocation
+try {
+    $result = $cosClient->getBucketLocation(array(
+        'Bucket' => 'lewzylu02',
+    ));
+} catch (\Exception $e) {
+    echo($e);
+};
+
+# 多版本相关
+## putBucketVersioning(开启关闭某个bucket的多版本)
+try {
+    $result = $cosClient->putBucketVersioning(array(
+        'Bucket' => $bucket,
+        'Status' => 'Enabled'
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## ListObjectVersions(列出多版本object)
+/*
+ * 同名文件会出现多个版本
+ */
+try {
+    $result = $cosClient->listObjectVersions(array(
+        'Bucket' => $bucket,
+        'Prefix' => 'string'
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## getBucketVersioning(获取某个bucket多版本属性)
+try {
+    $result = $cosClient->getBucketVersioning(
+        array('Bucket' => $bucket));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# ACL相关
+## PutBucketAcl(设置bucketACL)
+try {
+    $result = $cosClient->putBucketAcl(array(
+        'Bucket' => $bucket,
+        'Grants' => array(
+            array(
+                'Grantee' => array(
+                    'DisplayName' => 'qcs::cam::uin/327874225:uin/327874225',
+                    'ID' => 'qcs::cam::uin/327874225:uin/327874225',
+                    'Type' => 'CanonicalUser',
+                ),
+                'Permission' => 'FULL_CONTROL',
+            ),
+            // ... repeated
+        ),
+        'Owner' => array(
+            'DisplayName' => 'qcs::cam::uin/3210232098:uin/3210232098',
+            'ID' => 'qcs::cam::uin/3210232098:uin/3210232098',
+        )));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## getBucketAcl(获取bucketACL)
+try {
+    $result = $cosClient->getBucketAcl(array(
+        'Bucket' => $bucket));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## putObjectAcl(设置objectACL)
+try {
+    $result = $cosClient->putObjectAcl(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Grants' => array(
+            array(
+                'Grantee' => array(
+                    'DisplayName' => 'qcs::cam::uin/327874225:uin/327874225',
+                    'ID' => 'qcs::cam::uin/327874225:uin/327874225',
+                    'Type' => 'CanonicalUser',
+                ),
+                'Permission' => 'FULL_CONTROL',
+            ),
+            // ... repeated
+        ),
+        'Owner' => array(
+            'DisplayName' => 'qcs::cam::uin/3210232098:uin/3210232098',
+            'ID' => 'qcs::cam::uin/3210232098:uin/3210232098',
+        )));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## GetObjectAcl(获取objectACL)
+try {
+    $result = $cosClient->getObjectAcl(array(
+        'Bucket' => $bucket,
+        'Key' => $key));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 生命周期相关
+## putBucketLifecycle(设置bucket生命周期)
+try {
+    $result = $cosClient->putBucketLifecycle(array(
+        'Bucket' => $bucket,
+        'Rules' => array(
+            array(
+                'Expiration' => array(
+                    'Days' => 1000,
+                ),
+                'ID' => 'id1',
+                'Filter' => array(
+                    'Prefix' => 'documents/',
+                ),
+                'Status' => 'Enabled',
+                'Transitions' => array(
+                    array(
+                        'Days' => 200,
+                        'StorageClass' => 'NEARLINE'),
+                ),
+            ),
+        )));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## getBucketLifecycle(获取bucket生命周期)
+try {
+    $result = $cosClient->getBucketLifecycle(array(
+        'Bucket' => $bucket,
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## deleteBucketLifecycle(删除bucket生命周期)
+try {
+    $result = $cosClient->deleteBucketLifecycle(array(
+        'Bucket' => $bucket,
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 跨域相关
+## putBucketCors(设置bucket跨域)
+try {
+    $result = $cosClient->putBucketCors(array(
+        'Bucket' => $bucket,
+        'CORSRules' => array(
+            array(
+                'ID' => '1234',
+                'AllowedHeaders' => array('*'),
+                'AllowedMethods' => array('PUT'),
+                'AllowedOrigins' => array('http://www.qq.com'),
+            ),
+        ),
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## getBucketCors(获取bucket跨域信息)
+try {
+    $result = $cosClient->getBucketCors(array());
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## deleteBucketCors(删除bucket跨域)
+try {
+    $result = $cosClient->deleteBucketCors(array(
+        // Bucket is required
+        'Bucket' => $bucket,
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 跨区域复制相关
+## PutBucketReplication(设置bucket跨区域复制)
+### 注意:目标bucket和源bucket都需要开启多版本
+try {
+    $result = $cosClient->putBucketReplication(array(
+        'Bucket' => $bucket,
+        'Role' => 'qcs::cam::uin/327874225:uin/327874225',
+        'Rules'=>array(
+            array(
+                'Status' => 'Enabled',
+                'ID' => 'string',
+                'Prefix' => 'string',
+                'Destination' => array(
+                    'Bucket' => 'qcs::cos:ap-guangzhou::lewzylu01-1252448703',
+                    'StorageClass' => 'standard',
+                ),
+                // ...repeated
+            ),
+        ),
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## GetBucketReplication(获取bucket跨区域复制信息)
+try {
+    $result = $cosClient->getBucketReplication(array(
+        'Bucket' => $bucket
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## DeleteBucketReplication(删除bucket跨区域复制信息)
+try {
+    $result = $cosClient->deleteBucketReplication(array(
+        'Bucket' => $bucket
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 回调相关
+## PutBucketNotification
+try {
+    $result = $cosClient->putBucketNotification(array(
+            "Bucket" => $bucket,
+            "CloudFunctionConfigurations"=> array(
+                array(
+                    "Id" => "test-1",
+                    "Filter" => array(
+                        "Key" => array(
+                            "FilterRules" => array(
+                                array(
+                                    "Name" => "Prefix",
+                                    "Value" => "111"
+                                ),
+                                array(
+                                    "Name" => "Suffix",
+                                    "Value" => "111"
+                                ),
+                            ),
+                        )
+                    ),
+                    "CloudFunction" => "qcs:0:video:sh:appid/1253125191:video/10010",
+                    "Events" => array(
+                        'Event' => "cos:ObjectCreated:*"
+                    )
+                ),
+                array(
+                    "Id" => "test-2",
+                    "Filter" => array(
+                        "Key" => array(
+                            "FilterRules" => array(
+                                array(
+                                    "Name" => "Prefix",
+                                    "Value" => "111"
+                                ),
+                                array(
+                                    "Name" => "Suffix",
+                                    "Value" => "111"
+                                ),
+                            ),
+                        )
+                    ),
+                    "CloudFunction" => "qcs:0:video:sh:appid/1253125191:video/10010",
+                    "Events" => array(
+                        'Event' => "cos:ObjectRemove:*"
+                    )
+                ),
+            ))
+    );
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## GetBucketNotification
+try {
+    $result = $cosClient->getBucketNotification(array(
+        'Bucket' => $bucket
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 复制
+## copyobject(简单复制)
+/*
+ * 将{bucket},{region},{cos_path},{versionId}替换成复制源的真实信息
+ */
+try {
+    $result = $cosClient->copyObject(array(
+        'Bucket' => $bucket,
+        'CopySource' => '{bucket}.cos.{region}.myqcloud.com/{cos_path}?versionId={versionId}',
+        'Key' => 'string',
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## Copy(分块并发复制)
+/*
+ * 将{bucket},{region},{cos_path},{versionId}替换成复制源的真实信息
+ */
+try {
+    $result = $cosClient->copy(
+        $bucket = $bucket,
+        $key = $key,
+        $copysource = '{bucket}.cos.{region}.myqcloud.com/{cos_path}',
+        $options = array('VersionId' => '{versionId}'
+        ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 恢复归档文件
+## restoreObject
+try {
+    $result = $cosClient->restoreObject(array(
+        'Bucket' => $bucket,
+        'Key' => $key,
+        'Days' => 7,
+        'CASJobParameters' => array(
+            'Tier' => 'Bulk',
+        ),
+    ));
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+# 其他服务
+## 列出某bucket下所有的object
+try {
+    $prefix = '';
+    $marker = '';
+    while (true) {
+        $result = $cosClient->listObjects(array(
+            'Bucket' => $bucket,
+            'Marker' => $marker,
+            'MaxKeys' => 1000
+        ));
+        foreach ($result['Contents'] as $rt) {
+            print_r($rt['Key'] . " ");
+            /*
+             * 使用下面的代码可以删除全部object
+             */
+            // try {
+            //     $result = $cosClient->deleteobjects(array(
+            //         'Bucket' => $bucket,
+            //         'Key' => $rt['Key']));
+            //     print_r($result);
+            // } catch (\Exception $e) {
+            //     echo($e);
+            // }
+        }
+        $marker = $result['NextMarker'];
+        if (!$result['IsTruncated']) {
+            break;
+        }
+    }
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## 删除所有因上传失败而产生的分块
+/*
+ * 可以清理掉因分块上传失败
+ */
+try {
+    while (true) {
+        $result = $cosClient->listMultipartUploads(
+            array('Bucket' => $bucket,
+                'Prefix' => ''));
+        if (count($result['Uploads']) == 0) {
+            break;
+        }
+        foreach ($result['Uploads'] as $upload) {
+            try {
+                $rt = $cosClient->abortMultipartUpload(array(
+                    'Bucket' => $bucket,
+                    'Key' => $upload['Key'],
+                    'UploadId' => $upload['UploadId']
+                ));
+                print_r($rt);
+            } catch (\Exception $e) {
+                echo($e);
+            }
+        }
+    }
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## 分块上传断点重传
+/*
+ * 仅适用于分块上传失败的情况
+ * 需要填写上传失败的uploadId
+ */
+try {
+    $result = $cosClient->resumeUpload(
+        $bucket = $bucket,
+        $key = $key,
+        $body = fopen("E:/test.txt", 'rb'),
+        $uploadId = '152448808231afdf221eb558ab15d1e455d2afd025c5663936142fdf5614ebf6d1668e2eda'
+    );
+    print_r($result);
+} catch (\Exception $e) {
+    echo($e);
+}
+
+## 删除某些前缀的空bucket
+function startsWith($haystack, $needle)
+{
+    $length = strlen($needle);
+    return (substr($haystack, 0, $length) === $needle);
+}
+
+try {
+    $result = $cosClient->listBuckets();
+    foreach ($result['Buckets'] as $bucket) {
+        $region = $bucket['Location'];
+        $name = $bucket['Name'];
+        if (startsWith($name, 'lewzylu')) {
+            try {
+                $cosClient2 = new Qcloud\Cos\Client(array(
+                    'region' => $region,
+                    'credentials' => array(
+                        //getenv为获取本地环境变量,请替换为真实密钥
+                        'secretId' => getenv('COS_KEY'),
+                        'secretKey' => getenv('COS_SECRET'))
+                ));
+                $rt = $cosClient2->deleteBucket(array('Bucket' => $name));
+                print_r($rt);
+            } catch (\Exception $e) {
+            }
+        }
+    }
+} catch (\Exception $e) {
+    echo($e);
+}

+ 27 - 0
vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php

@@ -0,0 +1,27 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        'Key' => 'exampleobject', 
+        'UploadId' => 'string',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 30 - 0
vendor/qcloud/cos-sdk-v5/sample/catchException.php

@@ -0,0 +1,30 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    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(); // 获取完整的响应
+}
+

+ 37 - 0
vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php

@@ -0,0 +1,37 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        '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);
+}
+

+ 28 - 0
vendor/qcloud/cos-sdk-v5/sample/copyObject.php

@@ -0,0 +1,28 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        'Key' => 'exampleobject',
+        'CopySource' => 'examplebucket2-125000000.cos.ap-guangzhou.myqcloud.com/exampleobject',
+        'MetadataDirective' => 'Replaced',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/createBucket.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 39 - 0
vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php

@@ -0,0 +1,39 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        '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);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 26 - 0
vendor/qcloud/cos-sdk-v5/sample/deleteObject.php

@@ -0,0 +1,26 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        'Key' => 'exampleobject',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 36 - 0
vendor/qcloud/cos-sdk-v5/sample/getObject.php

@@ -0,0 +1,36 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        '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);
+}
+

+ 25 - 0
vendor/qcloud/cos-sdk-v5/sample/headBucket.php

@@ -0,0 +1,25 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->headBucket(array(
+        'Bucket' => 'examplebucket-125000000' //格式:BucketName-APPID
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 26 - 0
vendor/qcloud/cos-sdk-v5/sample/headObject.php

@@ -0,0 +1,26 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->headObject(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Key' => 'exampleobject',
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 24 - 0
vendor/qcloud/cos-sdk-v5/sample/listBucket.php

@@ -0,0 +1,24 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+
+try {
+    $result = $cosClient->listBuckets();
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 31 - 0
vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php

@@ -0,0 +1,31 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->listMultipartUploads(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Delimiter' => '/',
+        'EncodingType' => 'url',
+        'KeyMarker' => 'string',
+        'UploadIdMarker' => 'string',
+        'Prefix' => 'prfix',
+        'MaxUploads' => 1000,
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 30 - 0
vendor/qcloud/cos-sdk-v5/sample/listObjects.php

@@ -0,0 +1,30 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->listObjects(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Delimiter' => '/',
+        'EncodingType' => 'url',
+        'Marker' => 'prefix/picture.jpg',
+        'Prefix' => 'prfix',
+        'MaxKeys' => 1000,
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 29 - 0
vendor/qcloud/cos-sdk-v5/sample/listParts.php

@@ -0,0 +1,29 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->listParts(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Key' => 'exampleobject',
+        'UploadId' => 'NWNhNDY0YzFfMmZiNTM1MGFfNTM2YV8xYjliMTg',
+        'PartNumberMarker' => 1,
+        'MaxParts' => 1000,
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 41 - 0
vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php

@@ -0,0 +1,41 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->putBucketAcl(array(
+        //bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
+        'Bucket' => 'examplebucket-125000000',
+        'ACL' => 'private',
+        'Grants' => array(
+            array(
+                'Grantee' => array(
+                    'DisplayName' => 'qcs::cam::uin/100000000001:uin/100000000001',
+                    'ID' => 'qcs::cam::uin/100000000001:uin/100000000001',
+                    'Type' => 'CanonicalUser',
+                ),
+                'Permission' => 'FULL_CONTROL',
+            ),
+            // ... repeated
+        ),
+        'Owner' => array(
+            'DisplayName' => 'qcs::cam::uin/3210232098:uin/3210232098',
+            'ID' => 'qcs::cam::uin/3210232098:uin/3210232098',
+        )));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo "$e\n";
+}
+

+ 33 - 0
vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php

@@ -0,0 +1,33 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->putBucketCors(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'CORSRules' => array(
+            array(
+                'ID' => '1234',
+                'AllowedHeaders' => array('*'),
+                'AllowedMethods' => array('PUT'),
+                'AllowedOrigins' => array('http://www.qq.com'),
+            ),
+        ), 
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo "$e\n";
+}
+

+ 35 - 0
vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php

@@ -0,0 +1,35 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->putBucketCors(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'CORSRules' => array(
+            array(
+                'AllowedHeaders' => array('*',),
+                'AllowedMethods' => array('Put', ),
+                'AllowedOrigins' => array('*', ),
+                'ExposeHeaders' => array('*', ),
+                'MaxAgeSeconds' => 1,
+            ),
+            // ... repeated
+        )
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo "$e\n";
+}
+

+ 41 - 0
vendor/qcloud/cos-sdk-v5/sample/putObject.php

@@ -0,0 +1,41 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+$local_path = "/data/exampleobject";
+try {
+    $result = $cosClient->putObject(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Key' => 'exampleobject',
+        'Body' => fopen($local_path, 'rb'),
+        /*
+        '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);
+}
+

+ 30 - 0
vendor/qcloud/cos-sdk-v5/sample/restoreObject.php

@@ -0,0 +1,30 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$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
+        'Key' => 'exampleobject',
+        'Days' => integer,
+        'CASJobParameters' => array(
+            'Tier' =>'string'
+        )      
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 49 - 0
vendor/qcloud/cos-sdk-v5/sample/upload.php

@@ -0,0 +1,49 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+$local_path = "/data/exampleobject";
+try {
+    $result = $cosClient->upload(
+        $bucket = 'examplebucket-125000000', //格式:BucketName-APPID
+        $key = 'exampleobject',
+        $body = fopen($local_path, 'rb')
+        /*
+        $options = array(
+            'ACL' => 'string',
+            'CacheControl' => 'string',
+            'ContentDisposition' => 'string',
+            'ContentEncoding' => 'string',
+            'ContentLanguage' => 'string',
+            'ContentLength' => integer,
+            'ContentType' => 'string',
+            'Expires' => 'string',
+            'GrantFullControl' => 'string',
+            'GrantRead' => 'string',
+            'GrantWrite' => 'string',
+            'Metadata' => array(
+                'string' => 'string',
+            ),
+            'ContentMD5' => 'string',
+            'ServerSideEncryption' => 'string',
+            'StorageClass' => 'string'
+        )
+        */
+    );
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 31 - 0
vendor/qcloud/cos-sdk-v5/sample/uploadPart.php

@@ -0,0 +1,31 @@
+<?php
+
+require dirname(__FILE__) . '/../vendor/autoload.php';
+
+$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
+$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
+$region = "ap-beijing"; //设置一个默认的存储桶地域
+$cosClient = new Qcloud\Cos\Client(
+    array(
+        'region' => $region,
+        'schema' => 'https', //协议头部,默认为http
+        'credentials'=> array(
+            'secretId'  => $secretId ,
+            'secretKey' => $secretKey)));
+try {
+    $result = $cosClient->uploadPart(array(
+        'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
+        'Key' => 'exampleobject', 
+        'Body' => 'string',
+        'UploadId' => 'NWNhNDY0YzFfMmZiNTM1MGFfNTM2YV8xYjliMTg',
+        'PartNumber' => 1,
+        'ContentMD5' => 'string',
+        'ContentLength' => 100,
+    ));
+    // 请求成功
+    print_r($result);
+} catch (\Exception $e) {
+    // 请求失败
+    echo($e);
+}
+

+ 107 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/BucketStyleListener.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Common\Event;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Change from path style to host style, currently only host style is supported in cos.
+ */
+function endWith($haystack, $needle) {
+    $length = strlen($needle);
+    if($length == 0)
+    {
+        return true;
+    }
+    return (substr($haystack, -$length) === $needle);
+}
+class BucketStyleListener implements EventSubscriberInterface {
+
+    private $appId;  // string: application id.
+    private $ip;
+    private $port;
+    private $ipport;
+    private $endpoint;
+
+    public function __construct($appId, $ip=null, $port=null, $endpoint=null) {
+        $this->appId = $appId;
+        $this->ip = $ip;
+        $this->port = $port;
+        $this->ipport = null;
+        $this->endpoint = $endpoint;
+        if ($ip != null) {
+            $this->ipport = $ip;
+            if ($port != null) {
+                $this->ipport = $ip.":".$port;
+            }
+        }
+    }
+
+    public static function getSubscribedEvents() {
+        return array('command.after_prepare' => array('onCommandAfterPrepare', -230));
+    }
+
+    /**
+     * Change from path style to host style.
+     * @param Event $event Event emitted.
+     */
+    public function onCommandAfterPrepare(Event $event) {
+
+        $command = $event['command'];
+        $bucket = $command['Bucket'];
+        $request = $command->getRequest();
+        if ($command->getName() == 'ListBuckets')
+        {
+            if ($this->ipport != null) {
+                $request->setHost($this->ipport);
+                $request->setHeader('Host', 'service.cos.myqcloud.com');
+            } else if ($this->endpoint != null) {
+                $request->setHost($this->endpoint);
+                $request->setHeader('Host', 'service.cos.myqcloud.com');
+            }
+            else {
+
+                $request->setHost('service.cos.myqcloud.com');
+            }
+            return ;
+        }
+        if ($key = $command['Key']) {
+            // Modify the command Key to account for the {/Key*} explosion into an array
+            if (is_array($key)) {
+                $command['Key'] = $key = implode('/', $key);
+            }
+        }
+        $request->setHeader('Date', gmdate('D, d M Y H:i:s T'));
+
+        $url_bucket = rawurlencode($bucket);
+        $request->setPath(preg_replace("#^/{$url_bucket}#", '', $request->getPath()));
+        if ($this->appId != null && endWith($bucket,'-'.$this->appId) == False)
+        {
+            $bucket = $bucket.'-'.$this->appId;
+        }
+        $request->getParams()->set('bucket', $bucket)->set('key', $key);
+
+        $realHost = $bucket. '.' . $request->getHost();
+        if($this->ipport != null) {
+            $request->setHost($this->ipport);
+            $request->setHeader('Host', $realHost);
+        } else {
+            if($this->endpoint != null) {
+                $tmp = $bucket. '.' . $this->endpoint;
+                $request->setHost($tmp);
+            } else {
+                $request->setHost($realHost);
+            }
+        }
+        if (!$bucket) {
+            $request->getParams()->set('cos.resource', '/');
+        } else {
+            // Bucket style needs a trailing slash
+            $request->getParams()->set(
+                'cos.resource',
+                '/' . rawurlencode($bucket) . ($key ? ('/' . Client::encodeKey($key)) : '/')
+            );
+        }
+    }
+} 

+ 250 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Client.php

@@ -0,0 +1,250 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Service\Description\Parameter;
+use Guzzle\Service\Description\ServiceDescription;
+use Guzzle\Service\Client as GSClient;
+use Guzzle\Common\Collection;
+use Guzzle\Http\EntityBody;
+use Guzzle\Http\Message\RequestInterface;
+use Qcloud\Cos\Signature;
+use Qcloud\Cos\TokenListener;
+
+class Client extends GSClient {
+    const VERSION = '1.3.3';
+
+    private $region;       // string: region.
+    private $credentials;
+    private $appId;        // string: application id.
+    private $secretId;     // string: secret id.
+    private $secretKey;    // string: secret key.
+    private $timeout;      // int: timeout
+    private $connect_timeout; // int: connect_timeout
+    private $signature;
+    private $schema;
+    private $ip;
+    private $port;
+    private $config;
+    public function __construct($config) {
+        $this->config = $config;
+        $this->region = $config['region'];
+        $regionmap = array('cn-east'=>'ap-shanghai',
+            'cn-south'=>'ap-guangzhou',
+            'cn-north'=>'ap-beijing-1',
+            'cn-south-2'=>'ap-guangzhou-2',
+            'cn-southwest'=>'ap-chengdu',
+            'sg'=>'ap-singapore',
+            'tj'=>'ap-beijing-1',
+            'bj'=>'ap-beijing',
+            'sh'=>'ap-shanghai',
+            'gz'=>'ap-guangzhou',
+            'cd'=>'ap-chengdu',
+            'sgp'=>'ap-singapore',);
+        $this->schema = isset($config['schema']) ? $config['schema'] : 'http';
+        $this->ip = isset($config['ip']) ? $config['ip'] : null;
+        $this->port = isset($config['port']) ? $config['port'] : null;
+        $this->endpoint = isset($config['endpoint']) ? $config['endpoint'] : null;
+        $this->region =  isset($regionmap[$this->region]) ? $regionmap[$this->region] : $this->region;
+        $this->credentials = $config['credentials'];
+        $this->appId = isset($config['credentials']['appId']) ? $config['credentials']['appId'] : null;
+        $this->secretId = $config['credentials']['secretId'];
+        $this->secretKey = $config['credentials']['secretKey'];
+        $this->token = isset($config['credentials']['token']) ? $config['credentials']['token'] : null;
+        $this->timeout = isset($config['timeout']) ? $config['timeout'] : 3600;
+        $this->connect_timeout = isset($config['connect_timeout']) ? $config['connect_timeout'] : 3600;
+        $this->signature = new signature($this->secretId, $this->secretKey);
+        parent::__construct(
+            $this->schema.'://cos.' . $this->region . '.myqcloud.com/',    // base url
+            array('request.options' => array('timeout' => $this->timeout, 'connect_timeout' => $this->connect_timeout),
+            )); // show curl verbose or not
+        $desc = ServiceDescription::factory(Service::getService());
+        $this->setDescription($desc);
+        $this->setUserAgent('cos-php-sdk-v5.' . Client::VERSION, true);
+        $this->addSubscriber(new ExceptionListener());
+        $this->addSubscriber(new Md5Listener($this->signature));
+        $this->addSubscriber(new TokenListener($this->token));
+        $this->addSubscriber(new SignatureListener($this->secretId, $this->secretKey));
+        $this->addSubscriber(new BucketStyleListener($this->appId, $this->ip, $this->port, $this->endpoint));
+        $this->addSubscriber(new UploadBodyListener(array('PutObject', 'UploadPart')));
+    }
+
+    public function __destruct() {
+    }
+
+    public function __call($method, $args) {
+        return parent::__call(ucfirst($method), $args);
+    }
+
+    public function createAuthorization(RequestInterface $request, $expires)
+    {
+        if ($request->getClient() !== $this) {
+            throw new InvalidArgumentException('The request object must be associated with the client. Use the '
+                . '$client->get(), $client->head(), $client->post(), $client->put(), etc. methods when passing in a '
+                . 'request object');
+        }
+        return $this->signature->createAuthorization($request, $expires);
+    }
+    public function createPresignedUrl(RequestInterface $request, $expires)
+    {
+        if ($request->getClient() !== $this) {
+            throw new InvalidArgumentException('The request object must be associated with the client. Use the '
+                . '$client->get(), $client->head(), $client->post(), $client->put(), etc. methods when passing in a '
+                . 'request object');
+        }
+        return $this->signature->createPresignedUrl($request, $expires);
+    }
+    public function getObjectUrl($bucket, $key, $expires = null, array $args = array())
+    {
+        $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
+
+        if ($command->hasKey('Scheme')) {
+            $scheme = $command['Scheme'];
+            $request = $command->remove('Scheme')->prepare()->setScheme($scheme)->setPort(null);
+        } else {
+            $request = $command->prepare();
+        }
+
+        return $expires ? $this->createPresignedUrl($request, $expires) : $request->getUrl();
+    }
+    public function Upload($bucket, $key, $body, $options = array()) {
+        $body = EntityBody::factory($body);
+        $options = Collection::fromConfig(array_change_key_case($options), array(
+            'min_part_size' => MultipartUpload::MIN_PART_SIZE,
+            'params'        => $options));
+        if ($body->getSize() < $options['min_part_size']) {
+            // Perform a simple PutObject operation
+            $rt = $this->putObject(array(
+                    'Bucket' => $bucket,
+                    'Key'    => $key,
+                    'Body'   => $body,
+                ) + $options['params']);
+
+            $rt['Location'] = $rt['ObjectURL'];
+            $rt['Location'] = ltrim($rt['Location'], $this->schema. "://");
+            unset($rt['ObjectURL']);
+        }
+        else {
+            $multipartUpload = new MultipartUpload($this, $body, $options['min_part_size'], array(
+                    'Bucket' => $bucket,
+                    'Key' => $key,
+                    'Body' => $body,
+                ) + $options['params']);
+
+            $rt = $multipartUpload->performUploading();
+            unset($rt['Bucket']);
+            unset($rt['Key']);
+        }
+        return $rt;
+    }
+
+    public function resumeUpload($bucket, $key, $body, $uploadId, $options = array()) {
+        $body = EntityBody::factory($body);
+        $options = Collection::fromConfig(array_change_key_case($options), array(
+            'min_part_size' => MultipartUpload::MIN_PART_SIZE,
+            'params'        => $options));
+        $multipartUpload = new MultipartUpload($this, $body, $options['min_part_size'], array(
+                'Bucket' => $bucket,
+                'Key' => $key,
+                'Body' => $body,
+                'UploadId' => $uploadId,
+            ) + $options['params']);
+
+        $rt = $multipartUpload->resumeUploading();
+        return $rt;
+    }
+
+    public function Copy($bucket, $key, $copysource, $options = array()) {
+
+        $options = Collection::fromConfig(array_change_key_case($options), array(
+            'min_part_size' => Copy::MIN_PART_SIZE,
+            'params'        => $options));
+        $sourcelistdot  =  explode('.',$copysource);
+        $sourcelistline = explode('-',$sourcelistdot[0]);
+        $sourceappid = array_pop($sourcelistline);
+        $sourcebucket = implode('-', $sourcelistline);
+        $sourceregion = $sourcelistdot[2];
+        $sourcekey = substr(strstr($copysource,'/'),1);
+        $sourceversion = "";
+        $sourceconfig = $this->config;
+        $sourceconfig['region'] = $sourceregion;
+        $sourceconfig['credentials']['appId'] = $sourceappid;
+        $cosClient = new Client($sourceconfig);
+        if (!key_exists('VersionId',$options['params'])) {
+            $sourceversion = "";
+        }
+        else {
+            $sourceversion = $options['params']['VersionId'];
+        }
+        $rt = $cosClient->headObject(array('Bucket'=>$sourcebucket,
+            'Key'=>$sourcekey,
+            'VersionId'=>$sourceversion));
+        $contentlength =$rt['ContentLength'];
+
+        if ($contentlength < $options['min_part_size']) {
+            return $this->copyObject(array(
+                    'Bucket' => $bucket,
+                    'Key'    => $key,
+                    'CopySource'   => $copysource."?versionId=".$sourceversion,
+                ) + $options['params']);
+        }
+        $copy = new Copy($this, $contentlength, $copysource."?versionId=".$sourceversion, $options['min_part_size'], array(
+                'Bucket' => $bucket,
+                'Key'    => $key
+            ) + $options['params']);
+
+        return $copy->copy();
+    }
+
+    /**
+     * Determines whether or not a bucket exists by name
+     *
+     * @param string $bucket    The name of the bucket
+     * @param bool   $accept403 Set to true if 403s are acceptable
+     * @param array  $options   Additional options to add to the executed command
+     *
+     * @return bool
+     */
+    public function doesBucketExist($bucket, $accept403 = true, array $options = array())
+    {
+        try {
+            $this->HeadBucket(array(
+                'Bucket' => $bucket));
+            return True;
+        }catch (\Exception $e){
+            return False;
+        }
+    }
+
+    /**
+     * Determines whether or not an object exists by name
+     *
+     * @param string $bucket  The name of the bucket
+     * @param string $key     The key of the object
+     * @param array  $options Additional options to add to the executed command
+     *
+     * @return bool
+     */
+    public function doesObjectExist($bucket, $key, array $options = array())
+    {
+        try {
+            $this->HeadObject(array(
+                'Bucket' => $bucket,
+                'Key' => $key));
+            return True;
+        }catch (\Exception $e){
+            return False;
+        }
+    }
+    public static function encodeKey($key) {
+//        return $key;
+        return str_replace('%2F', '/', rawurlencode($key));
+    }
+
+    public static function explodeKey($key) {
+        // Remove a leading slash if one is found
+        return explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key);
+//        return $key;
+//        return ltrim($key, "/");
+    }
+}

+ 39 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Command.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Service\Command\OperationCommand;
+use Guzzle\Service\Resource\Model;
+use Guzzle\Common\Event;
+
+/**
+ * Adds functionality to Qcloud Cos commands:
+ *   - Adds the PutObject URL to a response
+ *   - Allows creating a Pre-signed URL from any command
+ */
+class Command extends OperationCommand {
+    /**
+     * Create a pre-signed URL for the operation
+     *
+     * @param int|string $expires The Unix timestamp to expire at or a string that can be evaluated by strtotime
+     *
+     * @return string
+     */
+    public function createPresignedUrl($expires)
+    {
+        return $this->client->createPresignedUrl($this->prepare(), $expires);
+    }
+    public function createAuthorization($expires)
+    {
+        return $this->client->createAuthorization($this->prepare(), $expires);
+    }
+
+    protected function process() {
+        parent::process();
+        // Set the GetObject URL if using the PutObject operation
+        if ($this->result instanceof Model && $this->getName() == 'PutObject') {
+            $request = $this->getRequest();;
+            $this->result->set('ObjectURL', $request->getUrl());
+        }
+    }
+}

+ 140 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Copy.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Http\ReadLimitEntityBody;
+
+
+class Copy {
+    /**
+     * const var: part size from 5MB to 5GB, and max parts of 10000 are allowed for each upload.
+     */
+    const MIN_PART_SIZE = 5242880;
+    const MAX_PART_SIZE = 5368709120;
+    const MAX_PARTS     = 10000;
+
+    private $client;
+    private $source;
+    private $options;
+    private $partSize;
+    private $size;
+
+    public function __construct($client, $contentlength, $source, $minPartSize, $options = array()) {
+        $this->client = $client;
+        $this->source = $source;
+        $this->options = $options;
+        $this->size = $contentlength;
+        $this->partSize = $this->calculatePartSize($minPartSize);
+        $this->concurrency = isset($options['concurrency']) ? $options['concurrency'] : 10;
+        $this->retry = isset($options['retry']) ? $options['retry'] : 5;
+    }
+    public function copy() {
+        $uploadId= $this->initiateMultipartUpload();
+        for ($i = 0; $i < 5; $i += 1) {
+            $rt = $this->uploadParts($uploadId);
+            if ($rt == 0) {
+                break;
+            }
+            sleep(1 << $i);
+        }
+        return $this->client->completeMultipartUpload(array(
+            'Bucket' => $this->options['Bucket'],
+            'Key' => $this->options['Key'],
+            'UploadId' => $uploadId,
+            'Parts' => $this->parts));
+
+    }
+    public function uploadParts($uploadId) {
+        $commands = array();
+        $offset = 0;
+        $partNumber = 1;
+        $partSize = $this->partSize;
+        $finishedNum = 0;
+        $this->parts = array();
+        for (;;) {
+
+            if ($offset + $partSize  >= $this->size)
+            {
+                $partSize = $this->size - $offset;
+            }
+            $params = array(
+                'Bucket' => $this->options['Bucket'],
+                'Key' => $this->options['Key'],
+                'UploadId' => $uploadId,
+                'PartNumber' => $partNumber,
+                'CopySource'=> $this->source,
+                'CopySourceRange' => 'bytes='.((string)$offset).'-'.(string)($offset+$partSize - 1),
+            );
+            if(!isset($parts[$partNumber])) {
+                $commands[] = $this->client->getCommand('UploadPartCopy', $params);
+            }
+            if ($partNumber % $this->concurrency == 0) {
+                $this->client->execute($commands);
+                $commands = array();
+            }
+            ++$partNumber;
+            $offset += $partSize;
+            if ($this->size == $offset)
+            {
+                break;
+            }
+        }
+        if (!empty($commands)) {
+            $this->client->execute($commands);
+        }
+        try {
+            $marker = 0;
+            $finishedNum = 1;
+            while (true) {
+                $rt = $this->client->listParts(array(
+                    'Bucket' => $this->options['Bucket'],
+                    'Key' => $this->options['Key'],
+                    'PartNumberMarker' => $marker,
+                    'MaxParts' => 1000,
+                    'UploadId' => $uploadId));
+                if (!empty($rt['Parts'])) {
+                    foreach ($rt['Parts'] as $part) {
+                        $part = array('PartNumber' => $finishedNum, 'ETag' => $part['ETag']);
+                        $this->parts[$finishedNum] = $part;
+                        $finishedNum++;
+                    }
+                }
+                $marker = $rt['NextPartNumberMarker'];
+                if (!$rt['IsTruncated']) {
+                    break;
+                }
+            }
+        } catch (\Exception $e) {
+            echo($e);
+        }
+        if ($finishedNum == $partNumber) {
+            return 0;
+        } else {
+            return -1;
+        }
+
+    }
+
+
+    private function calculatePartSize($minPartSize)
+    {
+        $partSize = intval(ceil(($this->size / self::MAX_PARTS)));
+        $partSize = max($minPartSize, $partSize);
+        $partSize = min($partSize, self::MAX_PART_SIZE);
+        $partSize = max($partSize, self::MIN_PART_SIZE);
+
+        return $partSize;
+    }
+
+    private function initiateMultipartUpload() {
+        $result = $this->client->createMultipartUpload($this->options);
+        return $result['UploadId'];
+    }
+
+}
+function partUploadCopy($client, $params) {
+    $rt = $client->uploadPartCopy($params);
+//    $part = array('PartNumber' => $params['PartNumber'], 'ETag' => $rt['ETag']);
+    $rt['PartNumber'] = $params['PartNumber'];
+    return $rt;
+}

+ 5 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/BucketAlreadyExistsException.php

@@ -0,0 +1,5 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+class BucketAlreadyExistsException extends CosException {}

+ 6 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/BucketNotEmptyException.php

@@ -0,0 +1,6 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+// The bucket you tried to delete is not empty.
+class BucketNotEmptyException extends CosException {}

+ 7 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/CosException.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+use Qcloud\Cos\Exception\ServiceResponseException;
+
+class CosException extends ServiceResponseException {}

+ 5 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/CurlException.php

@@ -0,0 +1,5 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+class CurlException extends CosException {}

+ 5 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/InvalidArgumentException.php

@@ -0,0 +1,5 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+class InvalidArgumentException extends CosException {}

+ 6 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchBucketException.php

@@ -0,0 +1,6 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+// The specified bucket does not exist.
+class NoSuchBucketException extends CosException {}

+ 6 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchKeyException.php

@@ -0,0 +1,6 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+// The specified key does not exist.
+class NoSuchKeyException extends CosException {}

+ 8 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/NoSuchUploadException.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+/**
+ * The specified multipart upload does not exist.
+ */
+class NoSuchUploadException extends CosException {}

+ 189 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Exception/ServiceResponseException.php

@@ -0,0 +1,189 @@
+<?php
+
+namespace Qcloud\Cos\Exception;
+
+use Guzzle\Http\Message\RequestInterface;
+use Guzzle\Http\Message\Response;
+
+class ServiceResponseException extends \RuntimeException {
+
+    /**
+     * @var Response Response
+     */
+    protected $response;
+
+    /**
+     * @var RequestInterface Request
+     */
+    protected $request;
+
+    /**
+     * @var string Request ID
+     */
+    protected $requestId;
+
+    /**
+     * @var string Exception type (client / server)
+     */
+    protected $exceptionType;
+
+    /**
+     * @var string Exception code
+     */
+    protected $exceptionCode;
+
+    /**
+     * Set the exception code
+     *
+     * @param string $code Exception code
+     */
+    public function setExceptionCode($code) {
+        $this->exceptionCode = $code;
+    }
+
+    /**
+     * Get the exception code
+     *
+     * @return string|null
+     */
+    public function getExceptionCode() {
+        return $this->exceptionCode;
+    }
+
+    /**
+     * Set the exception type
+     *
+     * @param string $type Exception type
+     */
+    public function setExceptionType($type) {
+        $this->exceptionType = $type;
+    }
+
+    /**
+     * Get the exception type (one of client or server)
+     *
+     * @return string|null
+     */
+    public function getExceptionType() {
+        return $this->exceptionType;
+    }
+
+    /**
+     * Set the request ID
+     *
+     * @param string $id Request ID
+     */
+    public function setRequestId($id) {
+        $this->requestId = $id;
+    }
+
+    /**
+     * Get the Request ID
+     *
+     * @return string|null
+     */
+    public function getRequestId() {
+        return $this->requestId;
+    }
+
+    /**
+     * Set the associated response
+     *
+     * @param Response $response Response
+     */
+    public function setResponse(Response $response) {
+        $this->response = $response;
+    }
+
+    /**
+     * Get the associated response object
+     *
+     * @return Response|null
+     */
+    public function getResponse() {
+        return $this->response;
+    }
+
+    /**
+     * Set the associated request
+     *
+     * @param RequestInterface $request
+     */
+    public function setRequest(RequestInterface $request) {
+        $this->request = $request;
+    }
+
+    /**
+     * Get the associated request object
+     *
+     * @return RequestInterface|null
+     */
+    public function getRequest() {
+        return $this->request;
+    }
+
+    /**
+     * Get the status code of the response
+     *
+     * @return int|null
+     */
+    public function getStatusCode() {
+        return $this->response ? $this->response->getStatusCode() : null;
+    }
+
+    /**
+     * Cast to a string
+     *
+     * @return string
+     */
+    public function __toString() {
+        $message = get_class($this) . ': '
+            . 'Cos Error Code: ' . $this->getExceptionCode() . ', '
+            . 'Status Code: ' . $this->getStatusCode() . ', '
+            . 'Cos Request ID: ' . $this->getRequestId() . ', '
+            . 'Cos Error Type: ' . $this->getExceptionType() . ', '
+            . 'Cos Error Message: ' . $this->getMessage();
+
+        // Add the User-Agent if available
+        if ($this->request) {
+            $message .= ', ' . 'User-Agent: ' . $this->request->getHeader('User-Agent');
+        }
+
+        return $message;
+    }
+
+    /**
+     * Get the request ID of the error. This value is only present if a
+     * response was received, and is not present in the event of a networking
+     * error.
+     *
+     * Same as `getRequestId()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosRequestId() {
+        return $this->requestId;
+    }
+
+    /**
+     * Get the Cos error type.
+     *
+     * Same as `getExceptionType()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosErrorType() {
+        return $this->exceptionType;
+    }
+
+    /**
+     * Get the Cos error code.
+     *
+     * Same as `getExceptionCode()` method, but matches the interface for SDKv3.
+     *
+     * @return string|null Returns null if no response was received
+     */
+    public function getCosErrorCode() {
+        return $this->exceptionCode;
+    }
+}

+ 69 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/ExceptionListener.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Qcloud\Cos\Exception\ServiceResponseException;
+use Qcloud\Cos\Exception\NoSuchKeyException;
+
+use Guzzle\Common\Event;
+use Guzzle\Http\Message\RequestInterface;
+use Guzzle\Http\Message\Response;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Converts generic Guzzle response exceptions into cos specific exceptions
+ */
+class ExceptionListener implements EventSubscriberInterface {
+    protected $parser;
+    protected $defaultException;
+
+    public function __construct() {
+        $this->parser = new ExceptionParser();
+        $this->defaultException = 'Qcloud\Cos\Exception\ServiceResponseException';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function getSubscribedEvents() {
+        return array('request.error' => array('onRequestError', -1));
+    }
+
+    /**
+     * Throws a more meaningful request exception if available
+     *
+     * @param Event $event Event emitted
+     */
+    public function onRequestError(Event $event) {
+        $e = $this->fromResponse($event['request'], $event['response']);
+        $event->stopPropagation();
+        throw $e;
+    }
+
+    public function fromResponse(RequestInterface $request, Response $response) {
+        $parts = $this->parser->parse($request, $response);
+
+        $className = 'Qcloud\\Cos\\Exception\\' . $parts['code'];
+        if (substr($className, -9) !== 'Exception') {
+            $className .= 'Exception';
+        }
+
+        $className = class_exists($className) ? $className : $this->defaultException;
+
+        return $this->createException($className, $request, $response, $parts);
+    }
+
+    protected function createException($className, RequestInterface $request, Response $response, array $parts) {
+        $class = new $className($parts['message']);
+
+        if ($class instanceof ServiceResponseException) {
+            $class->setExceptionCode($parts['code']);
+            $class->setExceptionType($parts['type']);
+            $class->setResponse($response);
+            $class->setRequest($request);
+            $class->setRequestId($parts['request_id']);
+        }
+
+        return $class;
+    }
+}

+ 109 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/ExceptionParser.php

@@ -0,0 +1,109 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Http\Message\RequestInterface;
+use Guzzle\Http\Message\Response;
+
+/**
+ * Parses default XML exception responses
+ */
+class ExceptionParser {
+
+    public function parse(RequestInterface $request, Response $response) {
+        $data = array(
+            'code'       => null,
+            'message'    => null,
+            'type'       => $response->isClientError() ? 'client' : 'server',
+            'request_id' => null,
+            'parsed'     => null
+        );
+
+        $body = $response->getBody(true);
+
+        if (!$body) {
+            $this->parseHeaders($request, $response, $data);
+            return $data;
+        }
+
+        try {
+            $xml = new \SimpleXMLElement(utf8_encode($body));
+            $this->parseBody($xml, $data);
+            return $data;
+        } catch (\Exception $e) {
+            $data['code'] = 'PhpInternalXmlParseError';
+            $data['message'] = 'A non-XML response was received';
+            return $data;
+        }
+    }
+
+    /**
+     * Parses additional exception information from the response headers
+     *
+     * @param RequestInterface $request  Request that was issued
+     * @param Response         $response The response from the request
+     * @param array            $data     The current set of exception data
+     */
+    protected function parseHeaders(RequestInterface $request, Response $response, array &$data) {
+        $data['message'] = $response->getStatusCode() . ' ' . $response->getReasonPhrase();
+        if ($requestId = $response->getHeader('x-cos-request-id')) {
+            $data['request_id'] = $requestId;
+            $data['message'] .= " (Request-ID: $requestId)";
+        }
+
+        // Get the request
+        $status  = $response->getStatusCode();
+        $method  = $request->getMethod();
+
+        // Attempt to determine code for 403s and 404s
+        if ($status === 403) {
+            $data['code'] = 'AccessDenied';
+        } elseif ($method === 'HEAD' && $status === 404) {
+            $path   = explode('/', trim($request->getPath(), '/'));
+            $host   = explode('.', $request->getHost());
+            $bucket = (count($host) >= 4) ? $host[0] : array_shift($path);
+            $object = array_shift($path);
+
+            if ($bucket && $object) {
+                $data['code'] = 'NoSuchKey';
+            } elseif ($bucket) {
+                $data['code'] = 'NoSuchBucket';
+            }
+        }
+    }
+
+    /**
+     * Parses additional exception information from the response body
+     *
+     * @param \SimpleXMLElement $body The response body as XML
+     * @param array             $data The current set of exception data
+     */
+    protected function parseBody(\SimpleXMLElement $body, array &$data) {
+        $data['parsed'] = $body;
+
+        $namespaces = $body->getDocNamespaces();
+        if (isset($namespaces[''])) {
+            // Account for the default namespace being defined and PHP not being able to handle it :(
+            $body->registerXPathNamespace('ns', $namespaces['']);
+            $prefix = 'ns:';
+        } else {
+            $prefix = '';
+        }
+
+        if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
+            $data['code'] = (string) $tempXml[0];
+        }
+
+        if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
+            $data['message'] = (string) $tempXml[0];
+        }
+
+        $tempXml = $body->xpath("//{$prefix}RequestId[1]");
+        if (empty($tempXml)) {
+            $tempXml = $body->xpath("//{$prefix}RequestID[1]");
+        }
+        if (isset($tempXml[0])) {
+            $data['request_id'] = (string) $tempXml[0];
+        }
+    }
+}

+ 57 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Md5Listener.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Common\Event;
+use Guzzle\Service\Command\CommandInterface;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Adds required and optional Content-MD5 headers
+ */
+class Md5Listener implements EventSubscriberInterface
+{
+    /** @var S3SignatureInterface */
+    private $signature;
+
+    public static function getSubscribedEvents()
+    {
+        return array('command.after_prepare' => 'onCommandAfterPrepare');
+    }
+
+    public function __construct(Signature $signature)
+    {
+        $this->signature = $signature;
+    }
+
+    public function onCommandAfterPrepare(Event $event)
+    {
+        $command = $event['command'];
+        $operation = $command->getOperation();
+
+        if ($operation->getData('contentMd5')) {
+            // Add the MD5 if it is required for all signers
+            $this->addMd5($command);
+        } elseif ($operation->hasParam('ContentMD5')) {
+            $value = $command['ContentMD5'];
+            // Add a computed MD5 if the parameter is set to true or if
+            // not using Signature V4 and the value is not set (null).
+            if ($value === true ||
+                ($value === null && !($this->signature instanceof SignatureV4))
+            ) {
+                $this->addMd5($command);
+            }
+        }
+    }
+
+    private function addMd5(CommandInterface $command)
+    {
+        $request = $command->getRequest();
+        $body = $request->getBody();
+        if ($body && $body->getSize() > 0) {
+            if (false !== ($md5 = $body->getContentMd5(true, true))) {
+                $request->setHeader('Content-MD5', $md5);
+            }
+        }
+    }
+}

+ 132 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/MultipartUpload.php

@@ -0,0 +1,132 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Http\ReadLimitEntityBody;
+use Qcloud\Cos\Exception\CosException;
+class MultipartUpload {
+    /**
+     * const var: part size from 5MB to 5GB, and max parts of 10000 are allowed for each upload.
+     */
+    const MIN_PART_SIZE = 5242880;
+    const MAX_PART_SIZE = 5368709120;
+    const MAX_PARTS     = 10000;
+
+    private $client;
+    private $source;
+    private $options;
+    private $partSize;
+
+    public function __construct($client, $source, $minPartSize, $options = array()) {
+        $this->client = $client;
+        $this->source = $source;
+        $this->options = $options;
+        $this->partSize = $this->calculatePartSize($minPartSize);
+    }
+
+    public function performUploading() {
+        $uploadId = $this->initiateMultipartUpload();
+
+        $partNumber = 1;
+        $parts = array();
+        for (;;) {
+            if ($this->source->isConsumed()) {
+                break;
+            }
+
+            $body = new ReadLimitEntityBody($this->source, $this->partSize, $this->source->ftell());
+            if ($body->getContentLength() == 0) {
+                break;
+            }
+            $result = $this->client->uploadPart(array(
+                        'Bucket' => $this->options['Bucket'],
+                        'Key' => $this->options['Key'],
+                        'Body' => $body,
+                        'UploadId' => $uploadId,
+                        'PartNumber' => $partNumber));
+            if (md5($body) != substr($result['ETag'], 1, -1)){
+                throw new CosException("ETag check inconsistency");
+            }
+            $part = array('PartNumber' => $partNumber, 'ETag' => $result['ETag']);
+            array_push($parts, $part);
+            ++$partNumber;
+        }
+        try {
+            $rt = $this->client->completeMultipartUpload(array(
+                'Bucket' => $this->options['Bucket'],
+                'Key' => $this->options['Key'],
+                'UploadId' => $uploadId,
+                'Parts' => $parts));
+        } catch(\Exception $e){
+            throw $e;
+        }
+        return $rt;
+    }
+
+    public function resumeUploading() {
+        $uploadId = $this->options['UploadId'];
+        $rt = $this->client->ListParts(
+            array('UploadId' => $uploadId,
+                'Bucket'=>$this->options['Bucket'],
+                'Key'=>$this->options['Key']));
+                $parts = array();
+        $offset = $this->partSize;
+        if (count($rt['Parts']) > 0) {
+            foreach ($rt['Parts'] as $part) {
+                $parts[$part['PartNumber'] - 1] = array('PartNumber' => $part['PartNumber'], 'ETag' => $part['ETag']);
+            }
+        }
+        for ($partNumber = 1;;++$partNumber,$offset+=$body->getContentLength()) {
+            if ($this->source->isConsumed()) {
+                break;
+            }
+
+            $body = new ReadLimitEntityBody($this->source, $this->partSize, $this->source->ftell());
+            if ($body->getContentLength() == 0) {
+                break;
+            }
+
+
+            if (array_key_exists($partNumber-1,$parts)){
+
+                if (md5($body) != substr($parts[$partNumber-1]['ETag'], 1, -1)){
+                    throw new CosException("ETag check inconsistency");
+                }
+                $body->setOffset($offset);
+                continue;
+            }
+
+            $result = $this->client->uploadPart(array(
+                'Bucket' => $this->options['Bucket'],
+                'Key' => $this->options['Key'],
+                'Body' => $body,
+                'UploadId' => $uploadId,
+                'PartNumber' => $partNumber));
+            if (md5($body) != substr($result['ETag'], 1, -1)){
+                throw new CosException("ETag check inconsistency");
+            }
+            $parts[$partNumber-1] = array('PartNumber' => $partNumber, 'ETag' => $result['ETag']);
+
+        }
+        $rt = $this->client->completeMultipartUpload(array(
+            'Bucket' => $this->options['Bucket'],
+            'Key' => $this->options['Key'],
+            'UploadId' => $uploadId,
+            'Parts' => $parts));
+        return $rt;
+    }
+
+    private function calculatePartSize($minPartSize) {
+        $partSize = intval(ceil(($this->source->getContentLength() / self::MAX_PARTS)));
+        $partSize = max($minPartSize, $partSize);
+        $partSize = min($partSize, self::MAX_PART_SIZE);
+        $partSize = max($partSize, self::MIN_PART_SIZE);
+
+        return $partSize;
+    }
+
+    private function initiateMultipartUpload() {
+        $result = $this->client->createMultipartUpload($this->options);
+        return $result['UploadId'];
+    }
+}

+ 4360 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Service.php

@@ -0,0 +1,4360 @@
+<?php
+
+namespace Qcloud\Cos;
+
+// http://guzzle3.readthedocs.io/webservice-client/guzzle-service-descriptions.html
+class Service {
+    public static function getService() {
+        return array(
+            'name' => 'Cos Service',
+            'apiVersion' => 'V5',
+            'description' => 'Cos V5 API Service',
+
+            'operations' => array(
+                /**
+                舍弃一个分块上传且删除已上传的分片块的方法.
+
+                COS 支持舍弃一个分块上传且删除已上传的分片块. 注意,已上传但是未终止的分片块会占用存储空间进 而产生存储费用.因此,建议及时完成分块上传 或者舍弃分块上传.
+
+                关于分块上传的具体描述,请查看 https://cloud.tencent.com/document/product/436/14112.
+
+                关于舍弃一个分块上传且删除已上传的分片块接口的描述,请查看 https://cloud.tencent.com/document/product/436/7740.
+
+                cos php SDK 中舍弃一个分块上传且删除已上传的分片块请求的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 AbortMultipfartUpload 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则操作成功。
+                 */
+                'AbortMultipartUpload' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'AbortMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId')),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified multipart upload does not exist.',
+                            'class' => 'NoSuchUploadException'))),
+                /**
+                创建存储桶(Bucket)的方法.
+
+                在开始使用 COS 时,需要在指定的账号下先创建一个 Bucket 以便于对象的使用和管理. 并指定 Bucket 所属的地域.创建 Bucket 的用户默认成为 Bucket 的持有者.若创建 Bucket 时没有指定访问权限,则默认 为私有读写(private)权限.
+
+                可用地域,可以查看https://cloud.tencent.com/document/product/436/6224.
+
+                关于创建 Bucket 描述,请查看 https://cloud.tencent.com/document/product/436/14106.
+
+                关于创建存储桶(Bucket)接口的具体 描述,请查看 https://cloud.tencent.com/document/product/436/7738.
+
+                cos php SDK 中创建 Bucket的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 CreateBucket 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则创建成功。
+
+                示例:
+                $result = $cosClient->createBucket(array('Bucket' => 'testbucket-1252448703'));
+                 */
+                'CreateBucket' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CreateBucketOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CreateBucketConfiguration')),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl'),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri')),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.',
+                            'class' => 'BucketAlreadyExistsException'))),
+                /**
+                完成整个分块上传的方法.
+
+                当使用分块上传(uploadPart(UploadPartRequest))完对象的所有块以后,必须调用该 completeMultiUpload(CompleteMultiUploadRequest) 或者 completeMultiUploadAsync(CompleteMultiUploadRequest, CosXmlResultListener) 来完成整个文件的分块上传.且在该请求的 Body 中需要给出每一个块的 PartNumber 和 ETag,用来校验块的准 确性.
+
+                分块上传适合于在弱网络或高带宽环境下上传较大的对象.SDK 支持自行切分对象并分别调用uploadPart(UploadPartRequest)上传各 个分块.
+
+                关于分块上传的描述,请查看 https://cloud.tencent.com/document/product/436/14112.
+
+                关于完成整个分片上传接口的描述,请查看 https://cloud.tencent.com/document/product/436/7742.
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 CompleteMultipartUpload 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则操作成功。
+
+                 */
+                'CompleteMultipartUpload' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CompleteMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CompleteMultipartUpload')),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'Parts' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true),
+                            'items' => array(
+                                'name' => 'CompletedPart',
+                                'type' => 'object',
+                                'sentAs' => 'Part',
+                                'properties' => array(
+                                    'ETag' => array(
+                                        'type' => 'string'),
+                                    'PartNumber' => array(
+                                        'type' => 'numeric')))),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml'))),
+                'CreateMultipartUpload' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}?uploads',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CreateMultipartUploadOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CreateMultipartUploadRequest')),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Cache-Control',
+                        ),
+                        'ContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Disposition',
+                        ),
+                        'ContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Encoding',
+                        ),
+                        'ContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Language',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'Metadata' => array(
+                            'type' => 'object',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-meta-',
+                            'additionalProperties' => array(
+                                'type' => 'string',
+                            ),
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ))),
+                'CopyObject' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'CopyObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CopyObjectRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Cache-Control',
+                        ),
+                        'ContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Disposition',
+                        ),
+                        'ContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Encoding',
+                        ),
+                        'ContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Language',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'CopySource' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source',
+                        ),
+                        'CopySourceIfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-match',
+                        ),
+                        'CopySourceIfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-modified-since',
+                        ),
+                        'CopySourceIfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-none-match',
+                        ),
+                        'CopySourceIfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-unmodified-since',
+                        ),
+                        'Expires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'Metadata' => array(
+                            'type' => 'object',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-meta-',
+                            'additionalProperties' => array(
+                                'type' => 'string',
+                            ),
+                        ),
+                        'MetadataDirective' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-metadata-directive',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'CopySourceSSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-algorithm',
+                        ),
+                        'CopySourceSSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key',
+                        ),
+                        'CopySourceSSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The source object of the COPY operation is not in the active tier.',
+                            'class' => 'ObjectNotInActiveTierErrorException',
+                        ),
+                    ),
+                ),
+                /**
+                删除存储桶 (Bucket)的方法.
+
+                COS 目前仅支持删除已经清空的 Bucket,如果 Bucket 中仍有对象,将会删除失败. 因此,在执行删除 Bucket 前,需确保 Bucket 内已经没有对象. 删除 Bucket 时,还需要确保操作的身份已被授权该操作,并确认 传入了正确的存储桶名称和地域参数, 请参阅 putBucket(PutBucketRequest).
+
+                关于删除 Bucket 的描述,请查看 https://cloud.tencent.com/document/product/436/14105.
+
+                关于删除 Bucket 接口的具体描述,请查看https://cloud.tencent.com/document/product/436/7732.
+
+                cos php SDK 中删除 Bucket 的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteBucket 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,删除成功。
+
+                示例:
+                $result = $cosClient->deleteBucket(array(
+                'Bucket' => 'testbucket-1252448703'));
+                print_r($result);
+                 */
+                'DeleteBucket' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'))),
+                /**
+                删除跨域访问配置信息的方法.
+
+                若是 Bucket 不需要支持跨域访问配置,可以调用此接口删除已配置的跨域访问信息. 跨域访问配置可以通过 putBucketCORS(PutBucketCORSRequest) 或者 putBucketCORSAsync(PutBucketCORSRequest, CosXmlResultListener) 方法来开启 Bucket 的跨域访问 支持.
+
+                关于删除跨域访问配置信息接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8283.
+
+                cos php SDK 中删除跨域访问配置信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteBucketCORS 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,删除成功。
+
+                示例:
+                $result = $cosClient->deleteBucketCors(array(
+                // Bucket is required
+                'Bucket' => 'testbucket-1252448703',
+                ));
+                 */
+                'DeleteBucketCors' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketCorsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                /**
+                删除 COS 上单个对象的方法.
+
+                COS 支持直接删除一个或多个对象,当仅需要删除一个对象时,只需要提供对象的名称(即对象键)即可.
+
+                关于删除 COS 上单个对象的具体描述,请查看 https://cloud.tencent.com/document/product/436/14119.
+
+                关于删除 COS 上单个对象接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/7743.
+
+                cos php SDK 中删除 COS 上单个对象请求的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteObject 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则删除成功。
+
+                示例:
+                $result = $cosClient->deleteObject(array(
+                'Bucket' => 'testbucket-1252448703',
+                'Key' => '111.txt',
+                'VersionId' => 'string'));
+                 */
+                'DeleteObject' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),)),
+                /**
+                批量删除 COS 对象的方法.
+
+                COS 支持批量删除指定 Bucket 中 对象,单次请求最大支持批量删除 1000 个 对象. 请求中删除一个不存在的对象,仍然认为是成功的. 对于响应结果,COS提供 Verbose 和 Quiet 两种模式:Verbose 模式将返回每个对象的删除结果;Quiet 模式只返回删除报错的对象信息. 请求必须携带 Content-MD5 用来校验请求Body 的完整性.
+
+                关于批量删除 COS 对象接口的描述,请查看https://cloud.tencent.com/document/product/436/8289.
+
+                cos php SDK 中批量删除 COS 对象的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteObjects 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则删除成功。
+
+                示例:
+                $result = $cosClient->deleteObjects(array(
+                // Bucket is required
+                'Bucket' => 'testbucket-1252448703',
+                // Objects is required
+                'Objects' => array(
+                array(
+                // Key is required
+                'Key' => 'string',
+                'VersionId' => 'string',
+                ),
+                // ... repeated
+                ),
+                ));
+                 */
+                'DeleteObjects' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}?delete',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteObjectsOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'Delete',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Objects' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ObjectIdentifier',
+                                'type' => 'object',
+                                'sentAs' => 'Object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                        'minLength' => 1,
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Quiet' => array(
+                            'type' => 'boolean',
+                            'format' => 'boolean-string',
+                            'location' => 'xml',
+                        ),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                /**
+                删除存储桶(Bucket) 的生命周期配置的方法.
+
+                COS 支持删除已配置的 Bucket 的生命周期列表. COS 支持以生命周期配置的方式来管理 Bucket 中 对象的生命周期,生命周期配置包含一个或多个将 应用于一组对象规则的规则集 (其中每个规则为 COS 定义一个操作),请参阅 putBucketLifecycle(PutBucketLifecycleRequest).
+
+                关于删除 Bucket 的生命周期配置接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8284.
+
+                cos php SDK 中删除 Bucket 的生命周期配置的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteBucketLifeCycle 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,删除成功。
+
+                示例:
+                $result = $cosClient->deleteBucketLifecycle(array(
+                // Bucket is required
+                'Bucket' =>'testbucket-1252448703',
+                ));
+                 */
+                'DeleteBucketLifecycle' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                /**
+                删除跨区域复制配置的方法.
+
+                当不需要进行跨区域复制时,可以删除 Bucket 的跨区域复制配置. 跨区域复制,可以查阅putBucketReplication(PutBucketReplicationRequest)
+
+                cos php SDK 中删除跨区域复制配置的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 DeleteBucketReplication 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,获取成功。
+
+                 */
+                'DeleteBucketReplication' => array(
+                    'httpMethod' => 'DELETE',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'DeleteBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                'GetObject' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'IfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-Match'),
+                        'IfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Modified-Since'),
+                        'IfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-None-Match'),
+                        'IfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Unmodified-Since'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'Range' => array(
+                            'type' => 'string',
+                            'location' => 'header'),
+                        'ResponseCacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-cache-control'),
+                        'ResponseContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-disposition'),
+                        'ResponseContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-encoding'),
+                        'ResponseContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-language'),
+                        'ResponseContentType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'response-content-type'),
+                        'ResponseExpires' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer'),
+                            'format' => 'date-time-http',
+                            'location' => 'query',
+                            'sentAs' => 'response-expires'),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'SaveAs' => array(
+                            'location' => 'response_body')),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified key does not exist.',
+                            'class' => 'NoSuchKeyException'))),
+                /**
+                获取 COS 对象的访问权限信息(Access Control List, ACL)的方法.
+
+                Bucket 的持有者可获取该 Bucket 下的某个对象的 ACL 信息,如被授权者以及被授权的信息. ACL 权限包括读、写、读写权限.
+
+                关于获取 COS 对象的 ACL 接口的具体描述,请查看https://cloud.tencent.com/document/product/436/7744.
+
+                cos php SDK 中获取 COS 对象的 ACL 的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetObjectAcl 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则获取成功。
+
+                示例:
+                $result = $cosClient->getObjectAcl(array(
+                'Bucket' => 'testbucket-1252448703',
+                'Key' => '11'));
+                 */
+                'GetObjectAcl' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetObjectAclOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified key does not exist.',
+                            'class' => 'NoSuchKeyException',
+                        ),
+                    ),
+                ),
+                /**
+                获取存储桶(Bucket) 的访问权限信息(Access Control List, ACL)的方法.
+
+                ACL 权限包括读、写、读写权限. COS 中 Bucket 是有访问权限控制的.可以通过获取 Bucket 的 ACL 表(putBucketACL(PutBucketACLRequest)),来查看那些用户拥有 Bucket 访 问权限.
+
+                关于获取 Bucket 的 ACL 接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/7733.
+
+                cos php SDK 中获取 Bucket 的 ACL 的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketACL 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则获取成功。
+
+
+                示例:
+                $result = $cosClient->GetBucketAcl(array(
+                'Bucket' => 'testbucket-1252448703',));
+                 */
+                'GetBucketAcl' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketAclOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml'))),
+                /**
+                查询存储桶(Bucket) 跨域访问配置信息的方法.
+
+                COS 支持查询当前 Bucket 跨域访问配置信息,以确定是否配置跨域信息.当跨域访问配置不存在时,请求 返回403 Forbidden. 跨域访问配置可以通过 putBucketCORS(PutBucketCORSRequest) 或者 putBucketCORSAsync(PutBucketCORSRequest, CosXmlResultListener) 方法来开启 Bucket 的跨域访问 支持.
+
+                关于查询 Bucket 跨域访问配置信息接口的具体描述, 请查看 https://cloud.tencent.com/document/product/436/8274.
+
+                cos php SDK 中查询 Bucket 跨域访问配置信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketCORS 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则获取成功。
+
+
+                示例:
+                $result = $cosClient->getBucketCors(array(
+                // Bucket is required
+                'Bucket' => 'testbucket-1252448703',
+                ));
+                 */
+                'GetBucketCors' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketCorsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                /**
+                查询存储桶(Bucket) 的生命周期配置的方法.
+
+                COS 支持以生命周期配置的方式来管理 Bucket 中对象的生命周期,生命周期配置包含一个或多个将 应用于一组对象规则的规则集 (其中每个规则为 COS 定义一个操作),请参阅 putBucketLifecycle(PutBucketLifecycleRequest).
+
+                关于查询 Bucket 的生命周期配置接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8278.
+
+                cos php SDK 中查询 Bucket 的生命周期配置的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketLifecycle 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则获取成功。
+
+
+                示例:
+                $result = $cosClient->getBucketLifecycle(array(
+                'Bucket' => 'testbucket-1252448703',
+                ));
+                 */
+                'GetBucketLifecycle' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                /**
+                获取存储桶(Bucket)版本控制信息的方法.
+
+                通过查询版本控制信息,可以得知该 Bucket 的版本控制功能是处于禁用状态还是启用状态(Enabled 或者 Suspended), 开启版本控制功能,可参考putBucketVersioning(PutBucketVersioningRequest).
+
+                cos php SDK 中获取 Bucket 版本控制信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketVersioning 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,获取成功。
+
+                示例:
+                $result = $cosClient->getBucketVersioning(
+                array('Bucket' => 'lewzylu02-1252448703'));
+                 */
+                'GetBucketVersioning' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?versioning',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketVersioningOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                /**
+                获取跨区域复制配置信息的方法.
+
+                跨区域复制是支持不同区域 Bucket 自动复制对象, 请查阅putBucketReplication(PutBucketReplicationRequest).
+
+                cos php SDK 中获取跨区域复制配置信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketReplication 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+                 */
+                'GetBucketReplication' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                /**
+                获取存储桶(Bucket) 所在的地域信息的方法.
+
+                在创建 Bucket 时,需要指定所属该 Bucket 所属地域信息.
+
+                COS 支持的地域信息,可查看https://cloud.tencent.com/document/product/436/6224.
+
+                关于获取 Bucket 所在的地域信息接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8275.
+
+                cos php SDK 中获取 Bucket 所在的地域信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 GetBucketLocation 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则获取成功。
+
+
+                示例:
+                $result = $cosClient->getBucketLocation(array(
+                'Bucket' => 'testbucket-1252448703',
+                ));
+                 */
+                'GetBucketLocation' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?location',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketLocationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                ),
+                'GetBucketNotification' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?notification',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'GetBucketNotificationOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                'UploadPart' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'UploadPartOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'UploadPartRequest')),
+                    'parameters' => array(
+                        'Body' => array(
+                            'type' => array(
+                                'string',
+                                'object'),
+                            'location' => 'body'),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length'),
+                        'ContentMD5' => array(
+                            'type' => array(
+                                'string',
+                                'boolean'),
+                            'location' => 'header',
+                            'sentAs' => 'Content-MD5'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'PartNumber' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'partNumber'),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ))),
+                'PutObject' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'PutObjectRequest')),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl'),
+                        'Body' => array(
+                            'type' => array(
+                                'string',
+                                'object'),
+                            'location' => 'body'),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'CacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Cache-Control'),
+                        'ContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Disposition'),
+                        'ContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Encoding'),
+                        'ContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Language'),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length'),
+                        'ContentMD5' => array(
+                            'type' => array(
+                                'string',
+                                'boolean'),
+                            'location' => 'header',
+                            'sentAs' => 'Content-MD5'),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'Metadata' => array(
+                            'type' => 'object',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-meta-',
+                            'additionalProperties' => array(
+                                'type' => 'string')
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ))),
+                /**
+                设置 COS 对象的访问权限信息(Access Control List, ACL)的方法.
+
+                ACL权限包括读、写、读写权限. COS 对象的 ACL 可以通过 header头部:"x-cos-acl","x-cos-grant-read","x-cos-grant-write", "x-cos-grant-full-control" 传入 ACL 信息,或者通过 Body 以 XML 格式传入 ACL 信息.这两种方式只 能选择其中一种,否则引起冲突. 传入新的 ACL 将覆盖原有 ACL信息.ACL策略数上限1000,建议用户不要每个上传文件都设置 ACL.
+
+                关于设置 COS 对象的ACL接口的具体描述,请查看https://cloud.tencent.com/document/product/436/7748.
+
+                cos PHP SDK 中设置 COS 对象的 ACL 的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutObjectAcl 对象中的方法发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则设置成功。
+
+                示例:
+                $cosClient->PutObjectAcl(array(
+                'Bucket' => $this->bucket,
+                'Key' => '11',
+                'Grants' => array(
+                array(
+                'Grantee' => array(
+                'DisplayName' => 'qcs::cam::uin/327874225:uin/327874225',
+                'ID' => 'qcs::cam::uin/327874225:uin/327874225',
+                'Type' => 'CanonicalUser',
+                ),
+                'Permission' => 'FULL_CONTROL',
+                ),
+                // ... repeated
+                ),
+                'Owner' => array(
+                'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+                 */
+                'PutObjectAcl' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutObjectAclOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AccessControlPolicy',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            'ID' => array(
+                                                'type' => 'string'),
+                                            'Type' => array(
+                                                'type' => 'string',
+                                                'sentAs' => 'xsi:type',
+                                                'data' => array(
+                                                    'xmlAttribute' => true,
+                                                    'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance')),
+                                            'URI' => array(
+                                                'type' => 'string') )),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWrite' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified key does not exist.',
+                            'class' => 'NoSuchKeyException',
+                        ),
+                    ),
+                ),
+                /**
+                设置存储桶(Bucket) 的访问权限(Access Control List, ACL)的方法.
+
+                ACL 权限包括读、写、读写权限. 写入 Bucket 的 ACL 可以通过 header头部:"x-cos-acl","x-cos-grant-read","x-cos-grant-write", "x-cos-grant-full-control" 传入 ACL 信息,或者通过 Body 以 XML 格式传入 ACL 信息.这两种方式只 能选择其中一种,否则引起冲突. 传入新的 ACL 将覆盖原有 ACL信息. 私有 Bucket 可以下可以给某个文件夹设置成公有,那么该文件夹下的文件都是公有;但是把文件夹设置成私有后,在该文件夹下的文件设置 的公有属性,不会生效.
+
+                关于设置 Bucket 的ACL接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/7737.
+
+                cos php SDK 中设置 Bucket 的ACL的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutObjectAcl 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+
+                示例:
+                $result = $cosClient->PutObjectAcl(array(
+                'Bucket' => 'testbucket-1252448703',
+                'Key' => '111',
+                'Grants' => array(
+                array(
+                'Grantee' => array(
+                'DisplayName' => 'qcs::cam::uin/327874225:uin/327874225',
+                'ID' => 'qcs::cam::uin/327874225:uin/327874225',
+                'Type' => 'CanonicalUser',
+                ),
+                'Permission' => 'FULL_CONTROL',
+                ),
+                // ... repeated
+                ),
+                'Owner' => array(
+                'DisplayName' => 'qcs::cam::uin/3210232098:uin/3210232098',
+                'ID' => 'qcs::cam::uin/3210232098:uin/3210232098',
+                ),));
+                 */
+                'PutBucketAcl' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?acl',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketAclOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'AccessControlPolicy',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'ACL' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-acl',
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'EmailAddress' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Type' => array(
+                                                'required' => true,
+                                                'type' => 'string',
+                                                'sentAs' => 'xsi:type',
+                                                'data' => array(
+                                                    'xmlAttribute' => true,
+                                                    'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance',
+                                                ),
+                                            ),
+                                            'URI' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'GrantFullControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-full-control',
+                        ),
+                        'GrantRead' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read',
+                        ),
+                        'GrantReadACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-read-acp',
+                        ),
+                        'GrantWrite' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write',
+                        ),
+                        'GrantWriteACP' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-grant-write-acp',
+                        ),
+                        'ACP' => array(
+                            'type' => 'object',
+                            'additionalProperties' => true,
+                        ),
+                    ),
+                ),
+                /**
+                设置存储桶(Bucket) 的跨域配置信息的方法.
+
+                跨域访问配置的预请求是指在发送跨域请求之前会发送一个 OPTIONS 请求并带上特定的来源域,HTTP 方 法和 header 信息等给 COS,以决定是否可以发送真正的跨域请求. 当跨域访问配置不存在时,请求返回403 Forbidden.
+
+                默认情况下,Bucket的持有者可以直接配置 Bucket的跨域信息 ,Bucket 持有者也可以将配置权限授予其他用户.新的配置是覆盖当前的所有配置信 息,而不是新增一条配置.可以通过传入 XML 格式的配置文件来实现配置,文件大小限制为64 KB.
+
+                关于设置 Bucket 的跨域配置信息接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/8279.
+
+                cos php SDK 中设置 Bucket 的跨域配置信息的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutBucketCORS 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+                示例:
+                $result = $cosClient->putBucketCors(array(
+                // Bucket is required
+                'Bucket' => 'testbucket-1252448703',
+                // CORSRules is required
+                'CORSRules' => array(
+                array(
+                'ID' => '1234',
+                'AllowedHeaders' => array('*'),
+                // AllowedMethods is required
+                'AllowedMethods' => array('PUT'),
+                // AllowedOrigins is required
+                'AllowedOrigins' => array('http://www.qq.com', ),
+                ),
+                // ... repeated
+                ),
+                ));
+                 */
+                'PutBucketCors' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?cors',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketCorsOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'CORSConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CORSRules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CORSRule',
+                                'type' => 'object',
+                                'sentAs' => 'CORSRule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'AllowedHeaders' => array(
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedHeader',
+                                        ),
+                                    ),
+                                    'AllowedMethods' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedMethod',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedMethod',
+                                        ),
+                                    ),
+                                    'AllowedOrigins' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedOrigin',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedOrigin',
+                                        ),
+                                    ),
+                                    'ExposeHeaders' => array(
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'ExposeHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'ExposeHeader',
+                                        ),
+                                    ),
+                                    'MaxAgeSeconds' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                /**
+                设置存储桶(Bucket) 生命周期配置的方法.
+
+                COS 支持以生命周期配置的方式来管理 Bucket 中对象的生命周期. 如果该 Bucket 已配置生命周期,新的配置的同时则会覆盖原有的配置. 生命周期配置包含一个或多个将应用于一组对象规则的规则集 (其中每个规则为 COS 定义一个操作)。这些操作分为以下两种:转换操作,过期操作.
+
+                转换操作,定义对象转换为另一个存储类的时间(例如,您可以选择在对象创建 30 天后将其转换为低频存储类别,同 时也支持将数据沉降到归档存储类别.
+
+                过期操作,指定 Object 的过期时间,COS 将会自动为用户删除过期的 Object.
+
+                关于Bucket 生命周期配置接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/8280
+
+                cos php SDK 中Bucket 生命周期配置的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutBucketLifecycle 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+                示例:
+                $result = $cosClient->putBucketLifecycle(array(
+                // Bucket is required
+                'Bucket' => 'lewzylu06-1252448703',
+                // Rules is required
+                'Rules' => array(
+                array(
+                'Expiration' => array(
+                'Days' => 1000,
+                ),
+                'ID' => 'id1',
+                'Filter' => array(
+                'Prefix' => 'documents/'
+                ),
+                // Status is required
+                'Status' => 'Enabled',
+                'Transitions' => array(
+                array(
+                'Days' => 200,
+                'StorageClass' => 'NEARLINE'),
+                ),
+                // ... repeated
+                ),
+                )));
+                 */
+                'PutBucketLifecycle' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?lifecycle',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketLifecycleOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'LifecycleConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Rules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'Rule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'Expiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => array(
+                                                    'object',
+                                                    'string',
+                                                    'integer',
+                                                ),
+                                                'format' => 'date-time',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'require' => true,
+                                        'properties' => array(
+                                            'Prefix' => array(
+                                                'type' => 'string',
+                                                'require' => true,
+                                            ),
+                                            'Tag' => array(
+                                                'type' => 'object',
+                                                'require' => true,
+                                                'properties' => array(
+                                                    'Key' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                    'filters' => array(
+                                                        'Qcloud\\Cos\\Client::explodeKey'),
+                                                    'Value' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                )
+                                            )
+                                        ),
+                                    ),
+                                    'Status' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Transitions' => array(
+                                        'type' => 'array',
+                                        'location' => 'xml',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'Transition',
+                                            'type' => 'object',
+                                            'sentAs' => 'Transition',
+                                            'properties' => array(
+                                                'Date' => array(
+                                                    'type' => array(
+                                                        'object',
+                                                        'string',
+                                                        'integer',
+                                                    ),
+                                                    'format' => 'date-time',
+                                                ),
+                                                'Days' => array(
+                                                    'type' => 'numeric',
+                                                ),
+                                                'StorageClass' => array(
+                                                    'type' => 'string',
+                                                )))),
+                                    'NoncurrentVersionTransition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionExpiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                /**
+                存储桶(Bucket)版本控制的方法.
+
+                版本管理功能一经打开,只能暂停,不能关闭. 通过版本控制,可以在一个 Bucket 中保留一个对象的多个版本. 版本控制可以防止意外覆盖和删除对象,以便检索早期版本的对象. 默认情况下,版本控制功能处于禁用状态,需要主动去启用或者暂停(Enabled 或者 Suspended).
+
+                cos php SDK 中 Bucket 版本控制启用或者暂停的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutBucketVersioning 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+                示例:
+                $result = $cosClient->putBucketVersioning(
+                array('Bucket' => 'testbucket-1252448703',
+                'Status' => 'Enabled'));
+                 */
+                'PutBucketVersioning' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?versioning',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketVersioningOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'VersioningConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'MFA' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-mfa',
+                        ),
+                        'MFADelete' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'MfaDelete',
+                        ),
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                    ),
+                ),
+                /**
+                配置跨区域复制的方法.
+
+                跨区域复制是支持不同区域 Bucket 自动异步复制对象.注意,不能是同区域的 Bucket, 且源 Bucket 和目 标 Bucket 必须已启用版本控制putBucketVersioning(PutBucketVersioningRequest).
+
+                cos php SDK 中配置跨区域复制的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 PutBucketRelication 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,设置成功。
+
+                示例:
+
+                 */
+                'PutBucketReplication' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?replication',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketReplicationOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'ReplicationConfiguration',
+                        ),
+                        'contentMd5' => true,
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Role' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Rules' => array(
+                            'required' => true,
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ReplicationRule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Prefix' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Status' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                    ),
+                                    'Destination' => array(
+                                        'required' => true,
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Bucket' => array(
+                                                'required' => true,
+                                                'type' => 'string',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                /**
+                设置存储桶(Bucket) 的回调设置的方法.
+                 */
+                'PutBucketNotification' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}?notification',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'PutBucketNotificationOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'NotificationConfiguration',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CloudFunctionConfigurations' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CloudFunctionConfiguration',
+                                'type' => 'object',
+                                'sentAs' => 'CloudFunctionConfiguration',
+                                'properties' => array(
+                                    'Id' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CloudFunction' => array(
+                                        'required' => true,
+                                        'type' => 'string',
+                                        'sentAs' => 'CloudFunction',
+                                    ),
+                                    'Events' => array(
+                                        'required' => true,
+                                        'type' => 'array',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'Event',
+                                            'type' => 'string',
+                                            'sentAs' => 'Event',
+                                        ),
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'object',
+                                                'sentAs' => 'Key',
+                                                'properties' => array(
+                                                    'FilterRules' => array(
+                                                        'type' => 'array',
+                                                        'data' => array(
+                                                            'xmlFlattened' => true,
+                                                        ),
+                                                        'items' => array(
+                                                            'name' => 'FilterRule',
+                                                            'type' => 'object',
+                                                            'sentAs' => 'FilterRule',
+                                                            'properties' => array(
+                                                                'Name' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                                'Value' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                            'filters' => array(
+                                                'Qcloud\\Cos\\Client::explodeKey')
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+                'RestoreObject' => array(
+                    'httpMethod' => 'POST',
+                    'uri' => '/{Bucket}{/Key*}?restore',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'RestoreObjectOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'RestoreRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'Days' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'CASJobParameters' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'Tier' => array(
+                                    'type' => 'string',
+                                    'required' => true,
+                                ),
+                            ),
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'This operation is not allowed against this storage tier',
+                            'class' => 'ObjectAlreadyInActiveTierErrorException',
+                        ),
+                    ),
+                ),
+                /**
+                查询存储桶(Bucket)中正在进行中的分块上传对象的方法.
+
+                COS 支持查询 Bucket 中有哪些正在进行中的分块上传对象,单次请求操作最多列出 1000 个正在进行中的 分块上传对象.
+
+                关于查询 Bucket 中正在进行中的分块上传对象接口的具体描述,请查看 https://cloud.tencent.com/document/product/436/7736.
+
+                cos php SDK 中查询 Bucket 中正在进行中的分块上传对象的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 ListParts 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,获取成功。
+
+                 */
+                'ListParts' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListPartsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')),
+                        'MaxParts' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-parts'),
+                        'PartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'part-number-marker'),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId'),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml'))),
+                /**
+                查询存储桶(Bucket) 下的部分或者全部对象的方法.
+
+                COS 支持列出指定 Bucket 下的部分或者全部对象.
+
+                每次默认返回的最大条目数为 1000 条.
+
+                如果无法一次返回所有的对象,则返回结果中的 IsTruncated 为 true,同时会附加一个 NextMarker 字段,提示下 一个条目的起点.
+
+                若一次请求,已经返回了全部对象,则不会有 NextMarker 这个字段,同时 IsTruncated 为 false.
+
+                若把 prefix 设置为某个文件夹的全路径名,则可以列出以此 prefix 为开头的文件,即该文件 夹下递归的所有文件和子文件夹.
+
+                如果再设置 delimiter 定界符为 “/”,则只列出该文件夹下的文件,子文件夹下递归的文件和文件夹名 将不被列出.而子文件夹名将会以 CommonPrefix 的形式给出.
+
+                关于查询Bucket 下的部分或者全部对象接口的具体描述,请查看https://cloud.tencent.com/document/product/436/7734.
+
+                cos php SDK 中查询 Bucket 下的部分或者全部对象的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 ListObjects 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,则list成功。
+
+                示例:
+                $result = $cosClient->ListObjects(array(
+                'Bucket' =>  'testbucket-1252448703'));
+                 */
+                'ListObjects' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListObjectsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri'),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter'),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type'),
+                        'Marker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'marker'),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-keys'),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix'),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml')),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified bucket does not exist.',
+                            'class' => 'NoSuchBucketException'))),
+                /**
+                获取所属账户的所有存储空间列表的方法.
+
+                通过使用帯 Authorization 签名认证的请求,可以获取签名中 APPID 所属账户的所有存储空间列表 (Bucket list).
+
+                关于获取所有存储空间列表接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8291.
+
+                cos php SDK 中获取所属账户的所有存储空间列表的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 ListBuckets 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,获取成功。
+
+                示例:
+                $result = $cosClient->listBuckets();
+                print_r($result);
+                 */
+                'ListBuckets' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListBucketsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                'ListObjectVersions' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?versions',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListObjectVersionsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter',
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'key-marker',
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-keys',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix',
+                        ),
+                        'VersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'version-id-marker',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                'ListMultipartUploads' => array(
+                    'httpMethod' => 'GET',
+                    'uri' => '/{Bucket}?uploads',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'ListMultipartUploadsOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'delimiter',
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'encoding-type',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'key-marker',
+                        ),
+                        'MaxUploads' => array(
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'max-uploads',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'prefix',
+                        ),
+                        'UploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'upload-id-marker',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),
+                'HeadObject' => array(
+                    'httpMethod' => 'HEAD',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'HeadObjectOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'IfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-Match',
+                        ),
+                        'IfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Modified-Since',
+                        ),
+                        'IfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'If-None-Match',
+                        ),
+                        'IfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'If-Unmodified-Since',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'Range' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'versionId',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified key does not exist.',
+                            'class' => 'NoSuchKeyException',
+                        ),
+                    ),
+                ),
+                /**
+                存储桶(Bucket) 是否存在的方法.
+
+                在开始使用 COS 时,需要确认该 Bucket 是否存在,是否有权限访问.若不存在,则可以调用putBucket(PutBucketRequest) 创建.
+
+                关于确认该 Bucket 是否存在,是否有权限访问接口的具体描述,请查看https://cloud.tencent.com/document/product/436/7735.
+
+                cos php SDK 中Bucket 是否存在的方法具体步骤如下:
+
+                1. 初始化客户端cosClient,填入存储桶名,和一些额外需要的参数,如授权的具体信息等。
+
+                2. 调用 HeadBucket 接口发出请求。
+
+                3. 接收该接口的返回数据,若没有抛出异常,获取成功。
+
+                示例:
+                $result = $cosClient->headObject(array(
+                'Bucket' => 'testbucket-1252448703',
+                'Key' => '11',
+                'VersionId' =>'111',
+                'ServerSideEncryption' => 'AES256'));
+                 */
+                'HeadBucket' => array(
+                    'httpMethod' => 'HEAD',
+                    'uri' => '/{Bucket}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'HeadBucketOutput',
+                    'responseType' => 'model',
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                    ),
+                    'errorResponses' => array(
+                        array(
+                            'reason' => 'The specified bucket does not exist.',
+                            'class' => 'NoSuchBucketException',
+                        ),
+                    ),
+                ),
+                'UploadPartCopy' => array(
+                    'httpMethod' => 'PUT',
+                    'uri' => '/{Bucket}{/Key*}',
+                    'class' => 'Qcloud\\Cos\\Command',
+                    'responseClass' => 'UploadPartCopyOutput',
+                    'responseType' => 'model',
+                    'data' => array(
+                        'xmlRoot' => array(
+                            'name' => 'UploadPartCopyRequest',
+                        ),
+                    ),
+                    'parameters' => array(
+                        'Bucket' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                        ),
+                        'CopySource' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source',
+                        ),
+                        'CopySourceIfMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-match',
+                        ),
+                        'CopySourceIfModifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-modified-since',
+                        ),
+                        'CopySourceIfNoneMatch' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-none-match',
+                        ),
+                        'CopySourceIfUnmodifiedSince' => array(
+                            'type' => array(
+                                'object',
+                                'string',
+                                'integer',
+                            ),
+                            'format' => 'date-time-http',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-if-unmodified-since',
+                        ),
+                        'CopySourceRange' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-range',
+                        ),
+                        'Key' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'uri',
+                            'minLength' => 1,
+                            'filters' => array(
+                                'Qcloud\\Cos\\Client::explodeKey')
+                        ),
+                        'PartNumber' => array(
+                            'required' => true,
+                            'type' => 'numeric',
+                            'location' => 'query',
+                            'sentAs' => 'partNumber',
+                        ),
+                        'UploadId' => array(
+                            'required' => true,
+                            'type' => 'string',
+                            'location' => 'query',
+                            'sentAs' => 'uploadId',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'CopySourceSSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-algorithm',
+                        ),
+                        'CopySourceSSECustomerKey' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key',
+                        ),
+                        'CopySourceSSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-server-side-encryption-customer-key-MD5',
+                        ),
+                        'RequestPayer' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-payer',
+                        ),
+                        'command.expects' => array(
+                            'static' => true,
+                            'default' => 'application/xml',
+                        ),
+                    ),
+                ),),
+            'models' => array(
+                'AbortMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'CreateBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'header'),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'CompleteMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'CreateMultipartUploadOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'Bucket'),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'UploadId' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ))),
+                'CopyObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'CopySourceVersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-version-id',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'DeleteBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteObjectsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Deleted' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'DeletedObject',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'DeleteMarker' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'DeleteMarkerVersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'Errors' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Error',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'Error',
+                                'type' => 'object',
+                                'sentAs' => 'Error',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Code' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Message' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'DeleteBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Body' => array(
+                            'type' => 'string',
+                            'instanceOf' => 'Guzzle\\Http\\EntityBody',
+                            'location' => 'body',
+                        ),
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'AcceptRanges' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'accept-ranges',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'Restore' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-restore',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Last-Modified',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'MissingMeta' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-missing-meta',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'CacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Cache-Control',
+                        ),
+                        'ContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Disposition',
+                        ),
+                        'ContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Encoding',
+                        ),
+                        'ContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Language',
+                        ),
+                        'ContentRange' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Range',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'Metadata' => array(
+                            'type' => 'object',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-meta-',
+                            'additionalProperties' => array(
+                                'type' => 'string',
+                            ),
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'ReplicationStatus' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-replication-status',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetObjectAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'sentAs' => 'Grant',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            /*
+                                                'EmailAddress' => array(
+                                                    'type' => 'string'),
+                                                */
+                                            'ID' => array(
+                                                'type' => 'string'),
+                                            /*
+                                                'Type' => array(
+                                                    'type' => 'string',
+                                                    'sentAs' => 'xsi:type',
+                                                    'data' => array(
+                                                        'xmlAttribute' => true,
+                                                        'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance')),
+                                                */
+                                            /*'URI' => array(
+                                                    'type' => 'string') */)),
+                                    'Permission' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string'),
+                                'ID' => array(
+                                    'type' => 'string'))),
+                        'Grants' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'AccessControlList',
+                            'items' => array(
+                                'name' => 'Grant',
+                                'type' => 'object',
+                                'sentAs' => 'Grant',
+                                'properties' => array(
+                                    'Grantee' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            /*
+                                                'EmailAddress' => array(
+                                                    'type' => 'string'),
+                                                */
+                                            'ID' => array(
+                                                'type' => 'string'),
+                                            /*
+                                                'Type' => array(
+                                                    'type' => 'string',
+                                                    'sentAs' => 'xsi:type',
+                                                    'data' => array(
+                                                        'xmlAttribute' => true,
+                                                        'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance')),
+                                                */
+                                            /*'URI' => array(
+                                                    'type' => 'string') */)),
+                                    'Permission' => array(
+                                        'type' => 'string')))),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'GetBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CORSRules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'CORSRule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CORSRule',
+                                'type' => 'object',
+                                'sentAs' => 'CORSRule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string'),
+                                    'AllowedHeaders' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedHeader',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedHeader',
+                                        ),
+                                    ),
+                                    'AllowedMethods' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedMethod',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedMethod',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedMethod',
+                                        ),
+                                    ),
+                                    'AllowedOrigins' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'AllowedOrigin',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'AllowedOrigin',
+                                            'type' => 'string',
+                                            'sentAs' => 'AllowedOrigin',
+                                        ),
+                                    ),
+                                    'ExposeHeaders' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'ExposeHeader',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'ExposeHeader',
+                                            'type' => 'string',
+                                            'sentAs' => 'ExposeHeader',
+                                        ),
+                                    ),
+                                    'MaxAgeSeconds' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Rules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Rule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'Rule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'Expiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Prefix' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Tag' => array(
+                                                'type' => 'object',
+                                                'properties' => array(
+                                                    'Key' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                    'Value' => array(
+                                                        'type' => 'string'
+                                                    ),
+                                                )
+                                            )
+                                        ),
+                                    ),
+                                    'Status' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Transition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Date' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'Days' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionTransition' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'NoncurrentVersionExpiration' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'NoncurrentDays' => array(
+                                                'type' => 'numeric',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketVersioningOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Status' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MFADelete' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                            'sentAs' => 'MfaDelete',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Role' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Rules' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Rule',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ReplicationRule',
+                                'type' => 'object',
+                                'sentAs' => 'Rule',
+                                'properties' => array(
+                                    'ID' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Status' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Destination' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Bucket' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'StorageClass' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketLocationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Location' => array(
+                            'type' => 'string',
+                            'location' => 'body',
+                            'filters' => array(
+                                'strval',
+                                'strip_tags',
+                                'trim',
+                            ),
+                        ),
+                    ),
+                ),
+                'UploadPartOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'UploadPartCopyOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CopySourceVersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-copy-source-version-id',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'PutObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutObjectAclOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketCorsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketLifecycleOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketVersioningOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketReplicationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'PutBucketNotificationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'RestoreObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListPartsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'Key' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'UploadId' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'PartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'),
+                        'NextPartNumberMarker' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'),
+                        'MaxParts' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'),
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml'),
+                        'Parts' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Part',
+                            'data' => array(
+                                'xmlFlattened' => true),
+                            'items' => array(
+                                'name' => 'Part',
+                                'type' => 'object',
+                                'sentAs' => 'Part',
+                                'properties' => array(
+                                    'PartNumber' => array(
+                                        'type' => 'numeric'),
+                                    'LastModified' => array(
+                                        'type' => 'string'),
+                                    'ETag' => array(
+                                        'type' => 'string'),
+                                    'Size' => array(
+                                        'type' => 'numeric')))),
+                        'Initiator' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'ID' => array(
+                                    'type' => 'string'),
+                                'DisplayName' => array(
+                                    'type' => 'string'))),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string'),
+                                'ID' => array(
+                                    'type' => 'string'))),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'ListObjectsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml'),
+                        'Marker' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'NextMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'Contents' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true),
+                            'items' => array(
+                                'name' => 'Object',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Key' => array(
+                                        'type' => 'string'),
+                                    'LastModified' => array(
+                                        'type' => 'string'),
+                                    'ETag' => array(
+                                        'type' => 'string'),
+                                    'Size' => array(
+                                        'type' => 'numeric'),
+                                    'StorageClass' => array(
+                                        'type' => 'string'),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string'),
+                                            'ID' => array(
+                                                'type' => 'string')))))),
+                        'Name' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml'),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true),
+                            'items' => array(
+                                'name' => 'CommonPrefix',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string')))),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml'),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id'))),
+                'ListBucketsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Buckets' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'items' => array(
+                                'name' => 'Bucket',
+                                'type' => 'object',
+                                'sentAs' => 'Bucket',
+                                'properties' => array(
+                                    'Name' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CreationDate' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Owner' => array(
+                            'type' => 'object',
+                            'location' => 'xml',
+                            'properties' => array(
+                                'DisplayName' => array(
+                                    'type' => 'string',
+                                ),
+                                'ID' => array(
+                                    'type' => 'string',
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListObjectVersionsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'VersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextKeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextVersionIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Versions' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Version',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'ObjectVersion',
+                                'type' => 'object',
+                                'sentAs' => 'Version',
+                                'properties' => array(
+                                    'ETag' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Size' => array(
+                                        'type' => 'numeric',
+                                    ),
+                                    'StorageClass' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'IsLatest' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'DeleteMarkers' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'DeleteMarker',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'DeleteMarkerEntry',
+                                'type' => 'object',
+                                'sentAs' => 'DeleteMarker',
+                                'properties' => array(
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'VersionId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'IsLatest' => array(
+                                        'type' => 'boolean',
+                                    ),
+                                    'LastModified' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'Name' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MaxKeys' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CommonPrefix',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'ListMultipartUploadsOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'Bucket' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'KeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'UploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextKeyMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Prefix' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'Delimiter' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'NextUploadIdMarker' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'MaxUploads' => array(
+                            'type' => 'numeric',
+                            'location' => 'xml',
+                        ),
+                        'IsTruncated' => array(
+                            'type' => 'boolean',
+                            'location' => 'xml',
+                        ),
+                        'Uploads' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'Upload',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'MultipartUpload',
+                                'type' => 'object',
+                                'sentAs' => 'Upload',
+                                'properties' => array(
+                                    'UploadId' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Key' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Initiated' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'StorageClass' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'Owner' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                    'Initiator' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'ID' => array(
+                                                'type' => 'string',
+                                            ),
+                                            'DisplayName' => array(
+                                                'type' => 'string',
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'CommonPrefixes' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CommonPrefix',
+                                'type' => 'object',
+                                'properties' => array(
+                                    'Prefix' => array(
+                                        'type' => 'string',
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'EncodingType' => array(
+                            'type' => 'string',
+                            'location' => 'xml',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'HeadObjectOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'DeleteMarker' => array(
+                            'type' => 'boolean',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-delete-marker',
+                        ),
+                        'AcceptRanges' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'accept-ranges',
+                        ),
+                        'Expiration' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-expiration',
+                        ),
+                        'Restore' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-restore',
+                        ),
+                        'LastModified' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Last-Modified',
+                        ),
+                        'ContentLength' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Length',
+                        ),
+                        'ETag' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'MissingMeta' => array(
+                            'type' => 'numeric',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-missing-meta',
+                        ),
+                        'VersionId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-version-id',
+                        ),
+                        'CacheControl' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Cache-Control',
+                        ),
+                        'ContentDisposition' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Disposition',
+                        ),
+                        'ContentEncoding' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Encoding',
+                        ),
+                        'ContentLanguage' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Language',
+                        ),
+                        'ContentType' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'Content-Type',
+                        ),
+                        'Expires' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                        ),
+                        'WebsiteRedirectLocation' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-website-redirect-location',
+                        ),
+                        'ServerSideEncryption' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption',
+                        ),
+                        'Metadata' => array(
+                            'type' => 'object',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-meta-',
+                            'additionalProperties' => array(
+                                'type' => 'string',
+                            ),
+                        ),
+                        'SSECustomerAlgorithm' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-algorithm',
+                        ),
+                        'SSECustomerKeyMD5' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-customer-key-MD5',
+                        ),
+                        'SSEKMSKeyId' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-server-side-encryption-aws-kms-key-id',
+                        ),
+                        'StorageClass' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-storage-class',
+                        ),
+                        'RequestCharged' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-charged',
+                        ),
+                        'ReplicationStatus' => array(
+                            'type' => 'string',
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-replication-status',
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ))),
+                'HeadBucketOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                ),
+                'GetBucketNotificationOutput' => array(
+                    'type' => 'object',
+                    'additionalProperties' => true,
+                    'properties' => array(
+                        'CloudFunctionConfigurations' => array(
+                            'type' => 'array',
+                            'location' => 'xml',
+                            'sentAs' => 'CloudFunctionConfiguration',
+                            'data' => array(
+                                'xmlFlattened' => true,
+                            ),
+                            'items' => array(
+                                'name' => 'CloudFunctionConfiguration',
+                                'type' => 'object',
+                                'sentAs' => 'CloudFunctionConfiguration',
+                                'properties' => array(
+                                    'Id' => array(
+                                        'type' => 'string',
+                                    ),
+                                    'CloudFunction' => array(
+                                        'type' => 'string',
+                                        'sentAs' => 'CloudFunction',
+                                    ),
+                                    'Events' => array(
+                                        'type' => 'array',
+                                        'sentAs' => 'Event',
+                                        'data' => array(
+                                            'xmlFlattened' => true,
+                                        ),
+                                        'items' => array(
+                                            'name' => 'Event',
+                                            'type' => 'string',
+                                            'sentAs' => 'Event',
+                                        ),
+                                    ),
+                                    'Filter' => array(
+                                        'type' => 'object',
+                                        'properties' => array(
+                                            'Key' => array(
+                                                'type' => 'object',
+                                                'sentAs' => 'Key',
+                                                'properties' => array(
+                                                    'FilterRules' => array(
+                                                        'type' => 'array',
+                                                        'sentAs' => 'FilterRule',
+                                                        'data' => array(
+                                                            'xmlFlattened' => true,
+                                                        ),
+                                                        'items' => array(
+                                                            'name' => 'FilterRule',
+                                                            'type' => 'object',
+                                                            'sentAs' => 'FilterRule',
+                                                            'properties' => array(
+                                                                'Name' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                                'Value' => array(
+                                                                    'type' => 'string',
+                                                                ),
+                                                            ),
+                                                        ),
+                                                    ),
+                                                ),
+                                            ),
+                                        ),
+                                    ),
+                                ),
+                            ),
+                        ),
+                        'RequestId' => array(
+                            'location' => 'header',
+                            'sentAs' => 'x-cos-request-id',
+                        ),
+                    ),
+                )));
+    }
+}

+ 50 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Signature.php

@@ -0,0 +1,50 @@
+<?php
+namespace Qcloud\Cos;
+use Guzzle\Http\Message\RequestInterface;
+class Signature {
+    private $accessKey;           // string: access key.
+    private $secretKey;           // string: secret key.
+    public function __construct($accessKey, $secretKey) {
+        $this->accessKey = $accessKey;
+        $this->secretKey = $secretKey;
+    }
+    public function __destruct() {
+    }
+    public function signRequest(RequestInterface $request) {
+        $signTime = (string)(time() - 60) . ';' . (string)(time() + 3600);
+        $httpString = strtolower($request->getMethod()) . "\n" . urldecode($request->getPath()) .
+            "\n\nhost=" . $request->getHost() . "\n";
+        $sha1edHttpString = sha1($httpString);
+        $stringToSign = "sha1\n$signTime\n$sha1edHttpString\n";
+        $signKey = hash_hmac('sha1', $signTime, $this->secretKey);
+        $signature = hash_hmac('sha1', $stringToSign, $signKey);
+        $authorization = 'q-sign-algorithm=sha1&q-ak='. $this->accessKey .
+            "&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=host&q-url-param-list=&" .
+            "q-signature=$signature";
+        $request->setHeader('Authorization', $authorization);
+    }
+    public function createAuthorization(
+        RequestInterface $request,
+        $expires = "10 minutes"
+    ) {
+        $signTime = (string)(time() - 60) . ';' . (string)(strtotime($expires));
+        $httpString = strtolower($request->getMethod()) . "\n" . urldecode($request->getPath()) .
+            "\n\nhost=" . $request->getHost() . "\n";
+        $sha1edHttpString = sha1($httpString);
+        $stringToSign = "sha1\n$signTime\n$sha1edHttpString\n";
+        $signKey = hash_hmac('sha1', $signTime, $this->secretKey);
+        $signature = hash_hmac('sha1', $stringToSign, $signKey);
+        $authorization = 'q-sign-algorithm=sha1&q-ak='. $this->accessKey .
+            "&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=host&q-url-param-list=&" .
+            "q-signature=$signature";
+        return $authorization;
+    }
+    public function createPresignedUrl(
+        RequestInterface $request,
+        $expires = "10 minutes"
+    ) {
+        $authorization = $this->createAuthorization($request, $expires);
+        $request->getQuery()->add('sign', $authorization);
+        return $request->getUrl();
+    }
+}

+ 45 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/SignatureListener.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Guzzle\Common\Event;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Listener used to sign requests before they are sent over the wire.
+ */
+class SignatureListener implements EventSubscriberInterface {
+    // cos signature.
+    protected $signature;
+
+    /**
+     * Construct a new request signing plugin
+     */
+    public function __construct($accessKey, $secretKey) {
+        $this->signature = new Signature($accessKey, $secretKey);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function getSubscribedEvents()
+    {
+        return array(
+            'request.before_send'        => array('onRequestBeforeSend', -255));
+    }
+
+    /**
+     * Signs requests before they are sent
+     *
+     * @param Event $event Event emitted
+     */
+    public function onRequestBeforeSend(Event $event) {
+
+        $this->signature->signRequest($event['request']);
+/*
+        if(!$this->credentials instanceof NullCredentials) {
+            $this->signature->signRequest($event['request'], $this->credentials);
+        }
+*/
+    }
+}

+ 1347 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Tests/Test.php

@@ -0,0 +1,1347 @@
+<?php
+
+namespace Qcloud\Cos\Tests;
+
+use Qcloud\Cos\Client;
+use Qcloud\Cos\Exception\ServiceResponseException;
+class BucketTest extends \PHPUnit_Framework_TestCase
+{
+    private $cosClient;
+    private $bucket;
+    protected function setUp()
+    {
+        $this->bucket = getenv('COS_BUCKET');
+        TestHelper::nuke($this->bucket);
+        $this->cosClient = new Client(array('region' => getenv('COS_REGION'),
+            'credentials' => array(
+                'appId' => getenv('COS_APPID'),
+                'secretId' => getenv('COS_KEY'),
+                'secretKey' => getenv('COS_SECRET'))));
+        sleep(5);
+    }
+
+    protected function tearDown()
+    {
+        TestHelper::nuke($this->bucket);
+    }
+
+    /**********************************
+     * TestBucket
+     **********************************/
+
+    /*
+     * put bucket,bucket已经存在
+     * BucketAlreadyOwnedByYou
+     * 409
+     */
+    public function testCreateExistingBucket()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'BucketAlreadyOwnedByYou' && $e->getStatusCode() === 409);
+        }
+    }
+
+    /*
+     * put bucket,bucket名称非法
+     * InvalidBucketName
+     * 400
+     */
+    public function testCreateInvalidBucket()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => 'qwe_213'));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidBucketName' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put bucket,设置bucket公公权限为private
+     * 200
+     */
+    public function testCreatePrivateBucket()
+    {
+        try {
+            $this->cosClient->createBucket(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'private'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket,设置bucket公公权限为public-read
+     * 200
+     */
+    public function testCreatePublicReadBucket()
+    {
+        try {
+            $this->cosClient->createBucket(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'public-read'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket,公共权限非法
+     * InvalidArgument
+     * 400
+     */
+    public function testCreateInvalidACLBucket()
+    {
+        try {
+            $this->cosClient->createBucket(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'public'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidArgument' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket公共权限为private
+     * 200
+     */
+    public function testPutBucketAclPrivate()
+    {
+        try {
+
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'private'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket公共权限为public-read
+     * 200
+     */
+    public function testPutBucketAclPublicRead()
+    {
+        try {
+
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'public-read'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,公共权限非法
+     * InvalidArgument
+     * 400
+     */
+    public function testPutBucketAclInvalid()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'ACL'=>'public'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidArgument' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限为grant-read
+     * 200
+     */
+    public function testPutBucketAclReadToUser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantRead' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限为grant-write
+     * 200
+     */
+    public function testPutBucketAclWriteToUser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限为grant-full-control
+     * 200
+     */
+    public function testPutBucketAclFullToUser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,同时授权给多个账户
+     * 200
+     */
+    public function testPutBucketAclToUsers()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970",id="qcs::cam::uin/2779643970:uin/2779643970",id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,授权给子账号
+     * 200
+     */
+    public function testPutBucketAclToSubuser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,同时指定read、write和fullcontrol
+     * 200
+     */
+    public function testPutBucketAclReadWriteFull()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantRead' => 'id="qcs::cam::uin/123:uin/123"',
+                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,grant值非法
+     * InvalidArgument
+     * 400
+     */
+    public function testPutBucketAclInvalidGrant()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::camuin/321023:uin/2779643970"',));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidArgument' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,通过body方式授权
+     * 200
+     */
+    public function testPutBucketAclByBody()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' => $this->bucket,
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,设置bucket账号权限,通过body方式授权给anyone
+     * 200
+     */
+    public function testPutBucketAclByBodyToAnyone()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' => $this->bucket,
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::anyone:anyone',
+                            'ID' => 'qcs::cam::anyone:anyone',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket acl,bucket不存在
+     * NoSuchBucket
+     * 404
+     */
+    public function testPutBucketAclBucketNonexisted()
+    {
+        try {
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::cam::uin/321023:uin/2779643970"',));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+        }
+    }
+
+    /*
+     * put bucket acl,覆盖设置
+     * x200
+     */
+    public function testPutBucketAclCover()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',
+                'GrantRead' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',
+                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+            $this->cosClient->PutBucketAcl(array(
+                'Bucket' =>  $this->bucket,
+                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 正常head bucket
+     * 200
+     */
+    public function testHeadBucket()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->HeadBucket(array(
+                'Bucket' =>  $this->bucket));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * head bucket,bucket不存在
+     * NoSuchBucket
+     * 404
+     */
+    public function testHeadBucketNonexisted()
+    {
+        try {
+            $this->cosClient->HeadBucket(array(
+                'Bucket' =>  $this->bucket,));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+        }
+    }
+
+    /*
+     * get bucket,bucket为空
+     * 200
+     */
+    public function testGetBucketEmpty()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->ListObjects(array(
+                'Bucket' =>  $this->bucket));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * get bucket,bucket不存在
+     * NoSuchBucket
+     * 404
+     */
+    public function testGetBucketNonexisted()
+    {
+        try {
+            $this->cosClient->ListObjects(array(
+                'Bucket' =>  $this->bucket,));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+        }
+    }
+
+
+    /*
+     * put bucket cors,cors规则包含多条
+     * 200
+     */
+    public function testPutBucketCors()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,
+                // CORSRules is required
+                'CORSRules' => array(
+                    array(
+                        'ID' => '1234',
+                        'AllowedHeaders' => array('*',),
+                        // AllowedMethods is required
+                        'AllowedMethods' => array('PUT',),
+                        // AllowedOrigins is required
+                        'AllowedOrigins' => array('*',),
+                        'ExposeHeaders' => array('*',),
+                        'MaxAgeSeconds' => 1,
+                    ),
+                    array(
+                        'ID' => '12345',
+                        'AllowedHeaders' => array('*',),
+                        // AllowedMethods is required
+                        'AllowedMethods' => array('PUT',),
+                        // AllowedOrigins is required
+                        'AllowedOrigins' => array('*',),
+                        'ExposeHeaders' => array('*',),
+                        'MaxAgeSeconds' => 1,
+                    ),
+                    // ... repeated
+                ),
+            ));
+            $this->cosClient->getBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+
+    /*
+     * 正常get bucket cors
+     * 200
+     */
+    public function testGetBucketCors()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,
+                // CORSRules is required
+                'CORSRules' => array(
+                    array(
+                        'ID' => '1234',
+                        'AllowedHeaders' => array('*',),
+                        // AllowedMethods is required
+                        'AllowedMethods' => array('PUT',),
+                        // AllowedOrigins is required
+                        'AllowedOrigins' => array('*',),
+                        'ExposeHeaders' => array('*',),
+                        'MaxAgeSeconds' => 1,
+                    ),
+                    array(
+                        'ID' => '12345',
+                        'AllowedHeaders' => array('*',),
+                        // AllowedMethods is required
+                        'AllowedMethods' => array('PUT',),
+                        // AllowedOrigins is required
+                        'AllowedOrigins' => array('*',),
+                        'ExposeHeaders' => array('*',),
+                        'MaxAgeSeconds' => 1,
+                    ),
+                    // ... repeated
+                ),
+            ));
+            $this->cosClient->getBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * bucket未设置cors规则,发送get bucket cors
+     * NoSuchCORSConfiguration
+     * 404
+     */
+    public function testGetBucketCorsNull()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->getBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchCORSConfiguration' && $e->getStatusCode() === 404);
+        }
+    }
+
+    /*
+     * bucket未设置cors规则,发送get bucket cors
+     * NoSuchCORSConfiguration
+     * 404
+     */
+    public function testGetBucketCorsNonExisted()
+    {
+        try {
+            $this->cosClient->getBucketCors(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+        }
+    }
+
+    /*
+     * 正常get bucket lifecycle
+     * 200
+     */
+    public function testGetBucketLifecycle()
+    {
+        try {
+            $result = $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $result = $this->cosClient->putBucketLifecycle(array(
+                    'Bucket' => $this->bucket,
+                    'Rules' => array(
+                        array(
+                            'Status' => 'Enabled',
+                            'Filter' => array(
+                                'Tag' => array(
+                                    'Key' => 'datalevel',
+                                    'Value' => 'backup'
+                                )
+                            ),
+                            'Transitions' => array(
+                                array(
+                                    # 30天后转换为Standard_IA
+                                    'Days' => 30,
+                                    'StorageClass' => 'Standard_IA'),
+                                array(
+                                    # 365天后转换为Archive
+                                    'Days' => 365,
+                                    'StorageClass' => 'Archive')
+                            ),
+                            'Expiration' => array(
+                                # 3650天后过期删除
+                                'Days' => 3650,
+                            )
+                        )
+                    )
+                ));
+            sleep(3);
+            $result = $this->cosClient->getBucketLifecycle(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,
+            ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 正常delete bucket lifecycle
+     * 200
+     */
+    public function testDeleteBucketLifecycle()
+    {
+        try {
+            $result = $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $result = $this->cosClient->putBucketLifecycle(array(
+                'Bucket' => $this->bucket,
+                'Rules' => array(
+                    array(
+                        'Status' => 'Enabled',
+                        'Filter' => array(
+                            'Tag' => array(
+                                'Key' => 'datalevel',
+                                'Value' => 'backup'
+                            )
+                        ),
+                        'Transitions' => array(
+                            array(
+                                # 30天后转换为Standard_IA
+                                'Days' => 30,
+                                'StorageClass' => 'Standard_IA'),
+                            array(
+                                # 365天后转换为Archive
+                                'Days' => 365,
+                                'StorageClass' => 'Archive')
+                        ),
+                        'Expiration' => array(
+                            # 3650天后过期删除
+                            'Days' => 3650,
+                        )
+                    )
+                )
+            ));
+            $result = $this->cosClient->deleteBucketLifecycle(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,
+            ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket lifecycle,请求body中不指定filter
+     * 200
+     */
+    public function testPutBucketLifecycleNonFilter()
+    {
+        try {
+            $result = $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $result = $this->cosClient->putBucketLifecycle(array(
+                // Bucket is required
+                'Bucket' => $this->bucket,
+                // Rules is required
+                'Rules' => array(
+                    array(
+                        'Expiration' => array(
+                            'Days' => 1000,
+                        ),
+                        'ID' => 'id1',
+                        // Status is required
+                        'Status' => 'Enabled',
+                        'Transitions' => array(
+                            array(
+                                'Days' => 100,
+                                'StorageClass' => 'Standard_IA'),
+                        ),
+                        // ... repeated
+                    ),
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+
+        }
+    }
+
+    /*
+     * put bucket,bucket名称带有-
+     * 200
+     */
+    public function testPutBucket2()
+    {
+        try {
+            try{
+                $this->cosClient->deleteBucket(array('Bucket' => '12345-'.$this->bucket));
+            } catch (\Exception $e) {
+            }
+            $this->cosClient->createBucket(array('Bucket' => '12345-'.$this->bucket));
+            $this->cosClient->deleteBucket(array('Bucket' => '12345-'.$this->bucket));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put bucket,bucket名称带有两个-
+     * 200
+     */
+    public function testPutBucket3()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket.'-12333-4445'));
+            $this->cosClient->deleteBucket(array('Bucket' => $this->bucket.'-12333-4445'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 正常get bucket location
+     * 200
+     */
+        public function testGetBucketLocation()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->getBucketLocation(array('Bucket' => $this->bucket));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * bucket不存在,发送get bucket location请求
+     * NoSuchBucket
+     * 404
+     */
+    public function testGetBucketLocationNonExisted()
+    {
+        try {
+            $this->cosClient->getBucketLocation(array('Bucket' => $this->bucket));
+        } catch (ServiceResponseException $e) {
+            //            echo($e->getExceptionCode());
+            //            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket' && $e->getStatusCode() === 404);
+        }
+    }
+
+    /**********************************
+     * TestObject
+     **********************************/
+
+    /*
+     * put object,请求头部携带服务端加密参数
+     * 200
+     */
+    public function testPutObjectEncryption()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '11//32//43',
+                'Body' => 'Hello World!',
+                'ServerSideEncryption' => 'AES256'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 上传文件Bucket不存在
+     * NoSuchBucket
+     * 404
+     */
+    public function testPutObjectIntoNonexistedBucket() {
+        try {
+            $this->cosClient->putObject(array(
+                'Bucket' => $this->bucket, 'Key' => 'hello.txt', 'Body' => 'Hello World'));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'NoSuchBucket');
+            $this->assertTrue($e->getStatusCode() === 404);
+        }
+    }
+
+
+    /*
+     * 上传小文件
+     * 200
+     */
+    public function testUploadSmallObject() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 上传空文件
+     * 200
+     */
+    public function testPutObjectEmpty() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', '123');
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 上传已存在的文件
+     * 200
+     */
+    public function testPutObjectExisted() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', '1234124');
+            $this->cosClient->upload($this->bucket, '你好.txt', '请二位qwe');
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object,请求头部携带自定义头部x-cos-meta-
+     * 200
+     */
+    public function testPutObjectMeta() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'Body' => '1234124',
+                'Metadata' => array(
+                     'lew' => str_repeat('a', 1 * 1024),
+            )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object,请求头部携带自定义头部x-cos-meta-
+     * KeyTooLong
+     * 400
+     */
+    public function testPutObjectMeta2K() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'Body' => '1234124',
+                'Metadata' => array(
+                    'lew' => str_repeat('a', 3 * 1024),
+                )));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'KeyTooLong' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * 上传复杂文件名的文件
+     * 200
+     */
+    public function testUploadComplexObject() {
+        try {
+            $result = $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '→↓←→↖↗↙↘! \"#$%&\'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', 'Hello World');
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 上传大文件
+     * 200
+     */
+    public function testUploadLargeObject() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, 'hello.txt', str_repeat('a', 9 * 1024 * 1024));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 下载文件
+     * 200
+     */
+    public function testGetObject() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * get object,object名称包含特殊字符
+     * 200
+     */
+    public function testGetObjectSpecialName() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好<>!@#^%^&*&(&^!@#@!.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好<>!@#^%^&*&(&^!@#@!.txt',));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * get object,请求头部带if-match,参数值为true
+     * 200
+     */
+    public function testGetObjectIfMatchTrue() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'IfMatch' => '"b10a8db164e0754105b7a99be72e3fe5"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+
+    /*
+     * get object,请求头部带if-match,参数值为false
+     * PreconditionFailed
+     * 412
+     */
+    public function testGetObjectIfMatchFalse() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'IfMatch' => '""'));
+        } catch (ServiceResponseException $e) {
+//            echo($e->getExceptionCode());
+//            echo($e->getStatusCode());
+            $this->assertTrue($e->getExceptionCode() === 'PreconditionFailed' && $e->getStatusCode() === 412);
+        }
+    }
+
+    /*
+     * get object,请求头部带if-none-match,参数值为true
+     * 200
+     */
+    public function testGetObjectIfNoneMatchTrue() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'IfNoneMatch' => '"b10a8db164e0754105b7a99be72e3fe5"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'NotModified' && $e->getStatusCode() === 304);
+        }
+    }
+
+
+    /*
+     * get object,请求头部带if-none-match,参数值为false
+     * PreconditionFailed
+     * 412
+     */
+    public function testGetObjectIfNoneMatchFalse() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '你好.txt', 'Hello World');
+            $this->cosClient->getObject(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'IfNoneMatch' => '""'));
+
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 获取文件url
+     * 200
+     */
+    public function testGetObjectUrl() {
+        try{
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->getObjectUrl($this->bucket, 'hello.txt', '+10 minutes');
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * 设置objectacl
+     * 200
+     */
+    public function testPutObjectACL() {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '11', 'hello.txt');
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' => $this->bucket,
+                'Key' => '11',
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+
+    }
+
+
+    /*
+     * 获取objectacl
+     * 200
+     */
+    public function testGetObjectACL()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->upload($this->bucket, '11', 'hello.txt');
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' => $this->bucket,
+                'Key' => '11',
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+        * put object acl,设置object公共权限为private
+        * 200
+        */
+    public function testPutObjectAclPrivate()
+    {
+        try {
+
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'Key' => '你好.txt',
+                    'ACL'=>'private'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object公共权限为public-read
+     * 200
+     */
+    public function testPutObjectAclPublicRead()
+    {
+        try {
+
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'Key' => '你好.txt',
+                    'ACL'=>'public-read'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,公共权限非法
+     * InvalidArgument
+     * 400
+     */
+    public function testPutObjectAclInvalid()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(
+                array(
+                    'Bucket' => $this->bucket,
+                    'Key' => '你好.txt',
+                    'ACL'=>'public'
+                ));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidArgument' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限为grant-read
+     * 200
+     */
+    public function testPutObjectAclReadToUser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' =>  $this->bucket,
+                'Key' => '你好.txt',
+                'GrantRead' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限为grant-write
+     * 200
+     */
+//    public function testPutObjectAclWriteToUser()
+//    {
+//        try {
+//            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+//            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+//            $this->cosClient->PutObjectAcl(array(
+//                'Bucket' =>  $this->bucket,
+//                'Key' => '你好.txt',
+//                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+//        } catch (ServiceResponseException $e) {
+//            $this->assertFalse(true, $e);
+//        }
+//    }
+
+    /*
+     * put object acl,设置object账号权限为grant-full-control
+     * 200
+     */
+    public function testPutObjectAclFullToUser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' =>  $this->bucket,
+                'Key' => '你好.txt',
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限,同时授权给多个账户
+     * 200
+     */
+    public function testPutObjectAclToUsers()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' =>  $this->bucket,
+                'Key' => '你好.txt',
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970",id="qcs::cam::uin/2779643970:uin/2779643970",id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限,授权给子账号
+     * 200
+     */
+    public function testPutObjectAclToSubuser()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' =>  $this->bucket,
+                'Key' => '你好.txt',
+                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"'));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限,同时指定read、write和fullcontrol
+     * 200
+     */
+//    public function testPutObjectAclReadWriteFull()
+//    {
+//        try {
+//            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+//            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+//            $this->cosClient->PutObjectAcl(array(
+//                'Bucket' =>  $this->bucket,
+//                'Key' => '你好.txt',
+//                'GrantRead' => 'id="qcs::cam::uin/123:uin/123"',
+//                'GrantWrite' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',
+//                'GrantFullControl' => 'id="qcs::cam::uin/2779643970:uin/2779643970"',));
+//        } catch (ServiceResponseException $e) {
+//            $this->assertFalse(true, $e);
+//        }
+//    }
+
+    /*
+     * put object acl,设置object账号权限,grant值非法
+     * InvalidArgument
+     * 400
+     */
+    public function testPutObjectAclInvalidGrant()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' =>  $this->bucket,
+                'Key' => '你好.txt',
+                'GrantFullControl' => 'id="qcs::camuin/321023:uin/2779643970"',));
+        } catch (ServiceResponseException $e) {
+            $this->assertTrue($e->getExceptionCode() === 'InvalidArgument' && $e->getStatusCode() === 400);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限,通过body方式授权
+     * 200
+     */
+    public function testPutObjectAclByBody()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->PutObjectAcl(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+    /*
+     * put object acl,设置object账号权限,通过body方式授权给anyone
+     * 200
+     */
+    public function testPutObjectAclByBodyToAnyone()
+    {
+        try {
+            $this->cosClient->createBucket(array('Bucket' => $this->bucket));
+            $this->cosClient->putObject(array('Bucket' => $this->bucket,'Key' => '你好.txt', 'Body' => '123'));
+            $this->cosClient->putObjectAcl(array(
+                'Bucket' => $this->bucket,
+                'Key' => '你好.txt',
+                'Grants' => array(
+                    array(
+                        'Grantee' => array(
+                            'DisplayName' => 'qcs::cam::anyone:anyone',
+                            'ID' => 'qcs::cam::anyone:anyone',
+                            'Type' => 'CanonicalUser',
+                        ),
+                        'Permission' => 'FULL_CONTROL',
+                    ),
+                    // ... repeated
+                ),
+                'Owner' => array(
+                    'DisplayName' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                    'ID' => 'qcs::cam::uin/2779643970:uin/2779643970',
+                )));
+        } catch (ServiceResponseException $e) {
+            $this->assertFalse(true, $e);
+        }
+    }
+
+}

+ 48 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/Tests/TestHelper.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace Qcloud\Cos\Tests;
+
+use Qcloud\Cos\Client;
+
+class TestHelper {
+
+    public static function nuke($bucket) {
+        try {
+            $cosClient = new Client(array('region' => getenv('COS_REGION'),
+                        'credentials'=> array(
+                        'appId' => getenv('COS_APPID'),
+                        'secretId'    => getenv('COS_KEY'),
+                        'secretKey' => getenv('COS_SECRET'))));
+            $result = $cosClient->listObjects(array('Bucket' => $bucket));
+            if ($result->get('Contents')) {
+                foreach ($result ->get('Contents') as $content) {
+                    $cosClient->deleteObject(array('Bucket' => $bucket, 'Key' => $content['Key']));
+                }
+            }
+            $cosClient->deleteBucket(array('Bucket' => $bucket));
+
+            while(True){
+                $result = $cosClient->ListMultipartUploads(
+                    array('Bucket' => $bucket,
+                        'Prefix' => ''));
+                if (count($result['Uploads']) == 0){
+                    break;
+                }
+                foreach ($result['Uploads'] as $upload) {
+                    try {
+                        $rt = $cosClient->AbortMultipartUpload(
+                            array('Bucket' => $bucket,
+                                'Key' => $upload['Key'],
+                                'UploadId' => $upload['UploadId']));
+                        print_r($rt);
+                    } catch (\Exception $e) {
+                        print_r($e);
+                    }
+                }
+            }
+        } catch (\Exception $e) {
+            //echo "$e\n";
+            // Ignore
+        }
+    }
+}

+ 48 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/TokenListener.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Aws\Common\Credentials\CredentialsInterface;
+use Aws\Common\Credentials\NullCredentials;
+use Guzzle\Common\Event;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Listener used to sign requests before they are sent over the wire.
+ */
+class TokenListener implements EventSubscriberInterface {
+    // cos signature.
+    protected $token;
+
+    /**
+     * Construct a new request signing plugin
+     */
+    public function __construct($token) {
+        $this->token = $token;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function getSubscribedEvents()
+    {
+        return array(
+            'request.before_send'        => array('onRequestBeforeSend', -240));
+    }
+
+    /**
+     * Signs requests before they are sent
+     *
+     * @param Event $event Event emitted
+     */
+    public function onRequestBeforeSend(Event $event) {
+        if ($this->token != null) {
+            $event['request']->setHeader('x-cos-security-token', $this->token);
+        }
+/*
+        if(!$this->credentials instanceof NullCredentials) {
+            $this->signature->signRequest($event['request'], $this->credentials);
+        }
+*/
+    }
+}

+ 79 - 0
vendor/qcloud/cos-sdk-v5/src/Qcloud/Cos/UploadBodyListener.php

@@ -0,0 +1,79 @@
+<?php
+
+namespace Qcloud\Cos;
+
+use Qcloud\Cos\Exception\InvalidArgumentException;
+use Guzzle\Common\Event;
+use Guzzle\Http\EntityBody;
+use Guzzle\Service\Command\AbstractCommand as Command;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Prepares the body parameter of a command such that the parameter is more flexible
+ * (e.g. accepts file handles) with the value it accepts but converts it to the correct format
+ * for the command. Also looks for a "Filename" parameter.
+ */
+class UploadBodyListener implements EventSubscriberInterface {
+    /**
+     * @var array The names of the commands of which to modify the body parameter
+     */
+    protected $commands;
+
+    /**
+     * @var string The key for the upload body parameter
+     */
+    protected $bodyParameter;
+
+    /**
+     * @var string The key for the source file parameter
+     */
+    protected $sourceParameter;
+
+    /**
+     * @param array  $commands        The commands to modify
+     * @param string $bodyParameter   The key for the body parameter
+     * @param string $sourceParameter The key for the source file parameter
+     */
+    public function __construct(array $commands, $bodyParameter = 'Body', $sourceParameter = 'SourceFile') {
+        $this->commands = $commands;
+        $this->bodyParameter = (string) $bodyParameter;
+        $this->sourceParameter = (string) $sourceParameter;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function getSubscribedEvents() {
+        return array('command.before_prepare' => array('onCommandBeforePrepare'));
+    }
+
+    /**
+     * Converts filenames and file handles into EntityBody objects before the command is validated
+     *
+     * @param Event $event Event emitted
+     * @throws InvalidArgumentException
+     */
+    public function onCommandBeforePrepare(Event $event) {
+        /** @var Command $command */
+        $command = $event['command'];
+        if (in_array($command->getName(), $this->commands)) {
+            // Get the interesting parameters
+            $source = $command->get($this->sourceParameter);
+            $body = $command->get($this->bodyParameter);
+
+            // If a file path is passed in then get the file handle
+            if (is_string($source) && file_exists($source)) {
+                $body = fopen($source, 'rb');
+            }
+
+            // Prepare the body parameter and remove the source file parameter
+            if (null !== $body) {
+                $command->remove($this->sourceParameter);
+                $command->set($this->bodyParameter, EntityBody::factory($body));
+            } else {
+                throw new InvalidArgumentException(
+                        "You must specify a non-null value for the {$this->bodyParameter} or {$this->sourceParameter} parameters.");
+            }
+        }
+    }
+}

+ 12 - 0
vendor/qiniu/php-sdk/.gitignore

@@ -0,0 +1,12 @@
+*.phar
+*.zip
+build/artifacts
+phpunit.xml
+phpunit.functional.xml
+.DS_Store
+.swp
+.build
+composer.lock
+vendor
+src/package.xml
+.idea/

+ 35 - 0
vendor/qiniu/php-sdk/.scrutinizer.yml

@@ -0,0 +1,35 @@
+filter:
+    excluded_paths: [tests/*]
+checks:
+    php:
+        code_rating: true
+        remove_extra_empty_lines: true
+        remove_php_closing_tag: true
+        remove_trailing_whitespace: true
+        fix_use_statements:
+            remove_unused: true
+            preserve_multiple: false
+            preserve_blanklines: true
+            order_alphabetically: true
+        fix_php_opening_tag: true
+        fix_linefeed: true
+        fix_line_ending: true
+        fix_identation_4spaces: true
+        fix_doc_comments: true
+tools:
+    external_code_coverage:
+        timeout: 1200
+        runs: 3
+    php_analyzer: true
+    php_code_coverage: false
+    php_code_sniffer:
+        config:
+            standard: PSR2
+        filter:
+            paths: ['src']
+    php_loc:
+        enabled: true
+        excluded_dirs: [vendor, tests]
+    php_cpd:
+        enabled: true
+        excluded_dirs: [vendor, tests]

+ 28 - 0
vendor/qiniu/php-sdk/.travis.yml

@@ -0,0 +1,28 @@
+sudo: false
+language: php
+
+php:
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7.0
+
+before_script:
+  - export QINIU_TEST_ENV="travis"
+  - travis_retry composer self-update
+  - travis_retry composer install --no-interaction --prefer-source --dev
+
+script:
+  - ./vendor/bin/phpcs --standard=PSR2 src
+  - ./vendor/bin/phpcs --standard=PSR2 examples
+  - ./vendor/bin/phpcs --standard=PSR2 tests
+  - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover tests/Qiniu/Tests/
+
+after_script:
+  - wget https://scrutinizer-ci.com/ocular.phar
+  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+
+env:
+  global:
+    - secure: "V9BsntXQZwvO9EOD6itzaae2uq+GemzyTUTxMTJx1/jFoUNpCU2O2UAgjA2XSEr5sgci0KWDV4Krbzv3EBB4uplOFLMI3w32256UHbT9E0x3YjhfPJZk68MH1iS1be7X81LDHON7yveavK8987s3qzjeUcbfLSPgccT+cvf7+dc="
+    - QINIU_ACCESS_KEY=vHg2e7nOh7Jsucv2Azr5FH6omPgX22zoJRWa0FN5

+ 105 - 0
vendor/qiniu/php-sdk/CHANGELOG.md

@@ -0,0 +1,105 @@
+# Changelog
+
+## 7.2.7 (2018-11-06)
+* 添加 QVM 内网上传到 KODO 的 zone 设置
+
+## 7.2.6 (2018-05-18)
+* 修复rs,rsf在不同机房默认的https域名
+
+## 7.2.5 (2018-05-10)
+* 修复表单上传中多余的参数checkCrc导致的fname错位问题
+
+## 7.2.4 (2018-05-09)
+### 增加
+* 连麦功能
+
+## 7.2.3 (2018-01-20)
+### 增加
+* 新加坡机房
+### 修正
+* 获取域名的入口域名
+* http回复头部兼容大小写
+
+## 7.2.2 (2017-11-06)
+### 增加
+* Qiniu算法的鉴权方法
+
+## 7.1.4 (2017-06-21)
+### 增加
+* cdn 文件/目录 刷新
+* cdn 获取 流量/带宽 
+* cdn 获取域名的访问日志列表
+* cdn 对资源链接进行时间戳防盗链签名
+
+## 7.1.3 (2016-11-18)
+### 增加
+* move, copy操作增加force参数
+
+## 7.1.2 (2016-11-12)
+### 修正
+* 明确抛出获取各区域域名失败时的报错
+
+## 7.1.1 (2016-11-02)
+### 修正
+* 多区域配置文件存储目录从home修改到tmp目录
+
+
+## 7.1.0 (2016-10-22)
+### 增加
+* 多存储区域的支持
+
+## 7.0.8 (2016-07-19)
+### 增加
+* demo
+* https url 支持
+* deleteAfterDays 策略
+* 添加图片处理链接统一拼接方法 by @SherlockRen
+
+## 7.0.7 (2016-01-12)
+### 修正
+* PersistentFop参数pipeline和notify_url失效
+* resume 模式 close file inputstream
+
+## 7.0.6 (2015-12-05)
+### 修正
+* php7.0 Json 对空字符串解析单元测试报错
+* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages
+* fetch 支持不指定key, by @sinkcup
+
+## 7.0.5 (2015-10-29)
+### 增加
+* 增加上传策略最小文件大小限制 fsizeMin
+* 增加常见examples
+
+## 7.0.4 (2015-07-23)
+### 修正
+* 一些地方的严格比较检查
+* resumeupload 备用地址失效
+
+## 7.0.3 (2015-07-10)
+### 修改
+* 多zone 支持
+
+## 7.0.2 (2015-04-18)
+### 修改
+* fetch 接口返回内容调整
+* pfop 接口调整
+
+###修正
+* exception 类调用
+
+## 7.0.1 (2015-03-27)
+### 增加
+* 增加代码注释
+
+## 7.0.0 (2015-02-03)
+
+### 增加
+* 简化上传接口
+* 自动选择断点续上传还是直传
+* 重构代码,接口和内部结构更清晰
+* 改变mime
+* 代码覆盖度报告
+* policy改为array, 便于灵活增加,并加入过期字段检查
+* 文件列表支持目录形式
+* 利用元编程方式支持 fop 和 pfop

+ 30 - 0
vendor/qiniu/php-sdk/CONTRIBUTING.md

@@ -0,0 +1,30 @@
+# 贡献代码指南
+
+我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。
+
+一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。
+
+## Pull Request要求
+
+- **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。
+
+- **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2  进行格式化。
+
+- **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。
+
+- **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。
+
+- **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。
+
+- **创建feature分支** - 最好不要从你的master分支提交 pull request。
+
+- **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。
+
+- **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。
+
+## 运行测试
+
+``` bash
+./vendor/bin/phpunit tests/Qiniu/Tests/
+
+```

+ 22 - 0
vendor/qiniu/php-sdk/LICENSE

@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Qiniu, Ltd.<sdk@qiniu.com>
+
+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.
+

+ 75 - 0
vendor/qiniu/php-sdk/README.md

@@ -0,0 +1,75 @@
+# Qiniu Cloud SDK for PHP
+[![doxygen.io](http://doxygen.io/github.com/qiniu/php-sdk/?status.svg)](http://doxygen.io/github.com/qiniu/php-sdk/)
+[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
+[![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk)
+[![Latest Stable Version](https://img.shields.io/packagist/v/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
+[![Total Downloads](https://img.shields.io/packagist/dt/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
+[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
+[![Code Coverage](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
+[![Join Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![@qiniu on weibo](http://img.shields.io/badge/weibo-%40qiniutek-blue.svg)](http://weibo.com/qiniutek)
+
+## 安装
+
+* 通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`][install-packagist] 。
+```bash
+$ composer require qiniu/php-sdk
+```
+* 直接下载安装,SDK 没有依赖其他第三方库,但需要参照 composer的autoloader,增加一个自己的autoloader程序。
+
+## 运行环境
+
+| Qiniu SDK版本 | PHP 版本 |
+|:--------------------:|:---------------------------:|
+|          7.x         |  cURL extension,   5.3 - 5.6,7.0 |
+|          6.x         |  cURL extension,   5.2 - 5.6 |
+
+## 使用方法
+
+### 上传
+```php
+use Qiniu\Storage\UploadManager;
+use Qiniu\Auth;
+...
+    $upManager = new UploadManager();
+    $auth = new Auth($accessKey, $secretKey);
+    $token = $auth->uploadToken($bucketName);
+    list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
+...
+```
+
+## 测试
+
+``` bash
+$ ./vendor/bin/phpunit tests/Qiniu/Tests/
+```
+
+## 常见问题
+
+- $error保留了请求响应的信息,失败情况下ret 为none, 将$error可以打印出来,提交给我们。
+- API 的使用 demo 可以参考 [单元测试](https://github.com/qiniu/php-sdk/blob/master/tests)。
+
+## 代码贡献
+
+详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)。
+
+## 贡献记录
+
+- [所有贡献者](https://github.com/qiniu/php-sdk/contributors)
+
+## 联系我们
+
+- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件)
+- 如果有什么问题,可以到问答社区提问,[问答社区](http://qiniu.segmentfault.com/)
+- 更详细的文档,见[官方文档站](http://developer.qiniu.com/)
+- 如果发现了bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
+- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
+- 如果要提交代码,欢迎提交 pull request
+- 欢迎关注我们的[微信](http://www.qiniu.com/#weixin) [微博](http://weibo.com/qiniutek),及时获取动态信息。
+
+## 代码许可
+
+The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).
+
+[packagist]: http://packagist.org
+[install-packagist]: https://packagist.org/packages/qiniu/php-sdk

+ 14 - 0
vendor/qiniu/php-sdk/autoload.php

@@ -0,0 +1,14 @@
+<?php
+
+function classLoader($class)
+{
+    $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
+    $file = __DIR__ . '/src/' . $path . '.php';
+
+    if (file_exists($file)) {
+        require_once $file;
+    }
+}
+spl_autoload_register('classLoader');
+
+require_once  __DIR__ . '/src/Qiniu/functions.php';

+ 26 - 0
vendor/qiniu/php-sdk/composer.json

@@ -0,0 +1,26 @@
+{
+    "name": "qiniu/php-sdk",
+    "type": "library",
+    "description": "Qiniu Resource (Cloud) Storage SDK for PHP",
+    "keywords": ["qiniu", "storage", "sdk", "cloud"],
+    "homepage": "http://developer.qiniu.com/",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Qiniu",
+            "email": "sdk@qiniu.com",
+            "homepage": "http://www.qiniu.com"
+        }
+    ],
+    "require": {
+        "php": ">=5.3.3"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "~4.0",
+        "squizlabs/php_codesniffer": "~2.3"
+    },
+    "autoload": {
+        "psr-4": {"Qiniu\\": "src/Qiniu"},
+        "files": ["src/Qiniu/functions.php"]
+    }
+}

+ 71 - 0
vendor/qiniu/php-sdk/docs/rtc/README.md

@@ -0,0 +1,71 @@
+# Rtc Streaming Cloud Server-Side Library For PHP
+
+## Features
+
+- Appclient
+    - [x] 创建房间: client->createApp()
+    - [x] 查看房间: client->getApp()
+    - [x] 删除房间: client->deleteApp()
+    - [x] 生成房间token: client->appToken()
+
+
+
+## Contents
+
+- [Installation](#installation)
+- [Usage](#usage)
+    - [Configuration](#configuration)
+    - [App](#app)
+        - [Create a app](#create-a-app)
+        - [Get a app](#get-a-app)
+        - [Delete a app](#delete-a-app)
+        - [Generate a app token](#generate-a-app-token)
+
+
+## Usage
+
+### App
+
+#### Create a app
+
+```php
+$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
+$sk = "xxxx";
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Rtc\AppClient($auth);
+$resp=$client->createApp("901","testApp");
+print_r($resp);
+```
+
+#### Get an app
+
+```php
+$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
+$sk = "xxxx";
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Rtc\AppClient($auth);
+$resp=$client->getApp("deq02uhb6");
+print_r($resp);
+```
+
+#### Delete an app
+
+```php
+$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
+$sk = "xxxx";
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Rtc\AppClient($auth);
+$resp=$client->deleteApp("deq02uhb6");
+print_r($resp);
+```
+
+#### Generate an app token
+
+```php
+$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
+$sk = "xxxx";
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Rtc\AppClient($auth);
+$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user');
+print_r($resp);
+```

+ 42 - 0
vendor/qiniu/php-sdk/docs/rtc/example.php

@@ -0,0 +1,42 @@
+<?php
+require_once("../../autoload.php");
+
+use \Qiniu\Auth;
+
+$ak = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5';
+$sk = 'xxxx';
+
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Rtc\AppClient($auth);
+$hub = 'lfxlive';
+$title = 'lfxl';
+try {
+    //创建app
+    $resp = $client->createApp($hub, $title, $maxUsers);
+    print_r($resp);
+    // 获取app状态
+    $resp = $client->getApp('dgdl5ge8y');
+    print_r($resp);
+    //修改app状态
+    $mergePublishRtmp = null;
+    $mergePublishRtmp['enable'] = true;
+    $resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp);
+    print_r($resp);
+    //删除app
+    $resp = $client->deleteApp('dgdl5ge8y');
+    print_r($resp);
+    //获取房间连麦的成员
+    $resp=$client->listUser("dgbfvvzid", 'lfxl');
+    print_r($resp);
+    //剔除房间的连麦成员
+    $resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6");
+    print_r($resp);
+    // 列举房间
+    $resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null);
+    print_r($resp);
+    //鉴权的有效时间: 1个小时.
+    $resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user');
+    print_r($resp);
+} catch (\Exception $e) {
+    echo "Error:", $e, "\n";
+}

+ 70 - 0
vendor/qiniu/php-sdk/docs/sms/example.php

@@ -0,0 +1,70 @@
+<?php
+require_once("../../autoload.php");
+
+use \Qiniu\Auth;
+
+$ak="xxxx";
+$sk="xxxx";
+
+$auth = new Auth($ak, $sk);
+$client = new Qiniu\Sms\Sms($auth);
+
+//发送信息模块
+$template_id="1131792074274775040";
+$mobiles=array("18011111111","18011111111");
+$code = array('code' => 'code' );
+try {
+    //发送短信
+    $resp = $client->sendMessage($template_id, $mobiles, $code);
+    print_r($resp);
+} catch (\Exception $e) {
+    echo "Error:", $e, "\n";
+}exit;
+//模板模块
+$name="tstest001";
+$template="tesy001 ${code}";
+$type="notification";
+$description="tstest001";
+$signature_id="1131464448834277376";
+$id="1131810682442883072";
+
+try {
+    //创建模板
+    $resp = $client->createTemplate($name, $template, $type, $description, $signature_id);
+    print_r($resp);
+    //查询模板
+    $resp = $client->queryTemplate();
+    print_r($resp);
+    //修改模板
+    $resp = $client->updateTemplate($id, $name, $template, $description, $signature_id);
+    print_r($resp);
+    //删除模板
+    $resp = $client->deleteTemplate($id);
+    print_r($resp);
+} catch (\Exception $e) {
+    echo "Error:", $e, "\n";
+}
+//签名模块
+$signature = 'lfxlive2';
+$source = 'enterprises_and_institutions';
+$pic="/Users/Desktop/sss.jpg";
+$audit_status="passed";
+$page=1;
+$page_size=1;
+$id="1131464448834277376";
+
+try {
+    //创建签名
+    $resp = $client->createSignature($signature, $source, $pic);
+    print_r($resp);
+     //查询签名
+    $resp = $client->checkSignature($audit_status);
+    //修改签名
+    $resp = $client->updateSignature($id, $signature, $source, $pic);
+    print_r($resp);
+    //删除ID
+    $resp = $client->deleteSignature($id);
+    print_r($resp);
+} catch (\Exception $e) {
+    echo "Error:", $e, "\n";
+}

+ 10 - 0
vendor/qiniu/php-sdk/examples/README.md

@@ -0,0 +1,10 @@
+# examples
+
+这些 examples 旨在帮助你快速了解使用七牛的sdk。这些demo都是可以直接运行的, 但是在运行之前需要填上您自己的参数。
+
+比如:
+
+* `$bucket`  需要填上您想操作的 [bucket名字](http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket)。
+* `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/setting/key)找到。
+* 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/mps/pipeline)新建。
+

+ 30 - 0
vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php

@@ -0,0 +1,30 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+$name = 'demo';
+$prefix = 'test';
+$delete_after_days = 80;
+$to_line_after_days =70;
+
+list($Info, $err) = $bucketManager->bucketLifecycleRule(
+    $bucket,
+    $name,
+    $prefix,
+    $delete_after_days,
+    $to_line_after_days
+);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 40 - 0
vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php

@@ -0,0 +1,40 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use \Qiniu\Cdn\CdnManager;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Qiniu\Auth($accessKey, $secretKey);
+$cdnManager = new CdnManager($auth);
+
+//获取流量和带宽数据
+//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
+
+$domains = array(
+    "javasdk.qiniudn.com",
+    "phpsdk.qiniudn.com"
+);
+
+$startDate = "2017-08-20";
+$endDate = "2017-08-21";
+
+//5min or hour or day
+$granularity = "day";
+
+//获取带宽数据
+list($bandwidthData, $getBandwidthErr) = $cdnManager->getBandwidthData(
+    $domains,
+    $startDate,
+    $endDate,
+    $granularity
+);
+
+if ($getBandwidthErr != null) {
+    var_dump($getBandwidthErr);
+} else {
+    echo "get bandwidth data success\n";
+    print_r($bandwidthData);
+}

+ 34 - 0
vendor/qiniu/php-sdk/examples/cdn_get_flux.php

@@ -0,0 +1,34 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use \Qiniu\Cdn\CdnManager;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Qiniu\Auth($accessKey, $secretKey);
+$cdnManager = new CdnManager($auth);
+
+//获取流量和带宽数据
+//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
+
+$domains = array(
+    "javasdk.qiniudn.com",
+    "phpsdk.qiniudn.com"
+);
+
+$startDate = "2017-08-20";
+$endDate = "2017-08-21";
+
+//5min or hour or day
+$granularity = "day";
+
+//获取流量数据
+list($fluxData, $getFluxErr) = $cdnManager->getFluxData($domains, $startDate, $endDate, $granularity);
+if ($getFluxErr != null) {
+    var_dump($getFluxErr);
+} else {
+    echo "get flux data success\n";
+    print_r($fluxData);
+}

+ 29 - 0
vendor/qiniu/php-sdk/examples/cdn_get_log_list.php

@@ -0,0 +1,29 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use \Qiniu\Cdn\CdnManager;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Qiniu\Auth($accessKey, $secretKey);
+$cdnManager = new CdnManager($auth);
+
+$domains = array(
+    "javasdk.qiniudn.com",
+    "phpsdk.qiniudn.com"
+);
+
+$logDate = '2017-08-20';
+
+//获取日志下载链接
+//参考文档:http://developer.qiniu.com/article/fusion/api/log.html
+
+list($logListData, $getLogErr) = $cdnManager->getCdnLogList($domains, $logDate);
+if ($getLogErr != null) {
+    var_dump($getLogErr);
+} else {
+    echo "get cdn log list success\n";
+    print_r($logListData);
+}

+ 52 - 0
vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php

@@ -0,0 +1,52 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use \Qiniu\Cdn\CdnManager;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Qiniu\Auth($accessKey, $secretKey);
+
+//待刷新的文件列表和目录,文件列表最多一次100个,目录最多一次10个
+//参考文档:http://developer.qiniu.com/article/fusion/api/refresh.html
+$urls = array(
+    "http://phpsdk.qiniudn.com/qiniu.jpg",
+    "http://phpsdk.qiniudn.com/qiniu2.jpg",
+);
+
+//刷新目录需要联系七牛技术支持开通账户权限
+$dirs = array(
+    "http://phpsdk.qiniudn.com/test/"
+);
+
+$cdnManager = new CdnManager($auth);
+
+// 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh
+// 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category
+list($refreshResult, $refreshErr) = $cdnManager->refreshUrlsAndDirs($urls, $dirs);
+if ($refreshErr != null) {
+    var_dump($refreshErr);
+} else {
+    echo "refresh request sent\n";
+    print_r($refreshResult);
+}
+
+//如果只有刷新链接或者目录的需求,可以分布使用
+
+list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls);
+if ($refreshErr != null) {
+    var_dump($refreshErr);
+} else {
+    echo "refresh request sent\n";
+    print_r($refreshResult);
+}
+
+list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs);
+if ($refreshErr != null) {
+    var_dump($refreshErr);
+} else {
+    echo "refresh request sent\n";
+    print_r($refreshResult);
+}

+ 19 - 0
vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php

@@ -0,0 +1,19 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use \Qiniu\Cdn\CdnManager;
+
+//创建时间戳防盗链
+//时间戳防盗链密钥,后台获取
+$encryptKey = 'your_domain_timestamp_antileech_encryptkey';
+
+//带访问协议的域名
+$url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo';
+$url2 = 'http://phpsdk.qiniuts.com/24.jpg';
+
+//有效期时间(单位秒)
+$durationInSeconds = 3600;
+
+$signedUrl = CdnManager::createTimestampAntiLeechUrl($url1, $encryptKey, $durationInSeconds);
+print($signedUrl);

+ 20 - 0
vendor/qiniu/php-sdk/examples/delete_bucket.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$name = 'xxxx';
+
+list($Info, $err) = $bucketManager->deleteBucket($name);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 21 - 0
vendor/qiniu/php-sdk/examples/delete_bucketEvent.php

@@ -0,0 +1,21 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+$name = 'demo';
+
+list($Info, $err) = $bucketManager->deleteBucketEvent($bucket, $name);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 21 - 0
vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php

@@ -0,0 +1,21 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+$name = 'demo';
+
+list($Info, $err) = $bucketManager->deleteBucketLifecycleRule($bucket, $name);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketEvents.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+
+list($Info, $err) = $bucketManager->getBucketEvents($bucket);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+
+list($Info, $err) = $bucketManager->getBucketLifecycleRules($bucket);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketList.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$region = 'z1';
+
+list($Info, $err) = $bucketManager->listbuckets($region);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketQuota.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+
+list($Info, $err) = $bucketManager->getBucketQuota($bucket);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketinfo.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+
+list($Info, $err) = $bucketManager->bucketInfo($bucket);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_bucketinfos.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$region = 'z1';
+
+list($Info, $err) = $bucketManager->bucketInfos($region);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 20 - 0
vendor/qiniu/php-sdk/examples/get_corsRules.php

@@ -0,0 +1,20 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+
+$auth = new Auth($accessKey, $secretKey);
+$config = new \Qiniu\Config();
+$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
+
+$bucket = 'xxxx';
+
+list($Info, $err) = $bucketManager->getCorsRules($bucket);
+if ($err) {
+    print_r($err);
+} else {
+    print_r($Info);
+}

+ 74 - 0
vendor/qiniu/php-sdk/examples/image_url_builder.php

@@ -0,0 +1,74 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+// 引入图片处理类
+use Qiniu\Processing\ImageUrlBuilder;
+
+$imageUrlBuilder = new ImageUrlBuilder();
+
+// 要处理图片
+$url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg';
+$url2 = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg?watermark/1/gravity/SouthEast/dx/0/dy/0/image/'
+    . 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB';
+$waterImage = 'http://developer.qiniu.com/resource/logo-2.jpg';
+
+/**
+ * 缩略图链接拼接
+ *
+ * @param  string $url 图片链接
+ * @param  int $mode 缩略模式
+ * @param  int $width 宽度
+ * @param  int $height 长度
+ * @param  string $format 输出类型 [可选]
+ * @param  int $quality 图片质量 [可选]
+ * @param  int $interlace 是否支持渐进显示 [可选]
+ * @param  int $ignoreError 忽略结果 [可选]
+ * @return string
+ * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html
+ * @author Sherlock Ren <sherlock_ren@icloud.com>
+ */
+$thumbLink = $imageUrlBuilder->thumbnail($url, 1, 100, 100);
+
+// 函数方式调用 也可拼接多个操作参数 图片+水印
+$thumbLink2 = \Qiniu\thumbnail($url2, 1, 100, 100);
+var_dump($thumbLink, $thumbLink2);
+
+/**
+ * 图片水印
+ *
+ * @param  string $url 图片链接
+ * @param  string $image 水印图片链接
+ * @param  numeric $dissolve 透明度 [可选]
+ * @param  string $gravity 水印位置 [可选]
+ * @param  numeric $dx 横轴边距 [可选]
+ * @param  numeric $dy 纵轴边距 [可选]
+ * @param  numeric $watermarkScale 自适应原图的短边比例 [可选]
+ * @link   http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html
+ * @return string
+ * @author Sherlock Ren <sherlock_ren@icloud.com>
+ */
+$waterLink = $imageUrlBuilder->waterImg($url, $waterImage);
+// 函数调用方法
+//$waterLink = \Qiniu\waterImg($url, $waterImage);
+var_dump($waterLink);
+
+/**
+ * 文字水印
+ *
+ * @param  string $url 图片链接
+ * @param  string $text 文字
+ * @param  string $font 文字字体
+ * @param  string $fontSize 文字字号
+ * @param  string $fontColor 文字颜色 [可选]
+ * @param  numeric $dissolve 透明度 [可选]
+ * @param  string $gravity 水印位置 [可选]
+ * @param  numeric $dx 横轴边距 [可选]
+ * @param  numeric $dy 纵轴边距 [可选]
+ * @link   http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark
+ * @return string
+ * @author Sherlock Ren <sherlock_ren@icloud.com>
+ */
+$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300);
+// 函数调用方法
+// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300);
+var_dump($textLink);

+ 19 - 0
vendor/qiniu/php-sdk/examples/persistent_fop_init.php

@@ -0,0 +1,19 @@
+<?php
+
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+$accessKey = 'Access_Key';
+$secretKey = 'Secret_Key';
+$auth = new Auth($accessKey, $secretKey);
+
+// 要转码的文件所在的空间。
+$bucket = 'Bucket_Name';
+
+// 转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
+$pipeline = 'pipeline_name';
+
+// 初始化
+$pfop = new PersistentFop($auth, $bucket, $pipeline);

+ 18 - 0
vendor/qiniu/php-sdk/examples/persistent_fop_status.php

@@ -0,0 +1,18 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Processing\PersistentFop;
+
+$pfop = new Qiniu\Processing\PersistentFop(null, null);
+
+// 触发持久化处理后返回的 Id
+$persistentId = 'z1.5b8a48e5856db843bc24cfc3';
+
+// 通过persistentId查询该 触发持久化处理的状态
+list($ret, $err) = $pfop->status($persistentId);
+
+if ($err) {
+    print_r($err);
+} else {
+    print_r($ret);
+}

+ 43 - 0
vendor/qiniu/php-sdk/examples/pfop_mkzip.php

@@ -0,0 +1,43 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+// 去我们的portal 后台来获取AK, SK
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+$bucket = getenv('QINIU_TEST_BUCKET');
+$key = 'qiniu.png';
+
+$auth = new Auth($accessKey, $secretKey);
+// 异步任务的队列, 去后台新建: https://portal.qiniu.com/mps/pipeline
+$pipeline = 'sdktest';
+
+$pfop = new PersistentFop($auth, null);
+
+// 进行zip压缩的url
+$url1 = 'http://phpsdk.qiniudn.com/php-logo.png';
+$url2 = 'http://phpsdk.qiniudn.com/1.png';
+
+//压缩后的key
+$zipKey = 'test.zip';
+
+$fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1);
+$fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2);
+$fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey");
+
+$notify_url = null;
+$force = false;
+
+list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notify_url, $force);
+
+echo "\n====> pfop mkzip result: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    echo "PersistentFop Id: $id\n";
+
+    $res = "http://api.qiniu.com/status/get/prefop?id=$id";
+    echo "Processing result: $res";
+}

+ 46 - 0
vendor/qiniu/php-sdk/examples/pfop_vframe.php

@@ -0,0 +1,46 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+//对已经上传到七牛的视频发起异步转码操作 
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+$bucket = getenv('QINIU_TEST_BUCKET');
+$auth = new Auth($accessKey, $secretKey);
+
+//要转码的文件所在的空间和文件名。
+$key = 'qiniu.mp4';
+
+//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
+$pipeline = 'sdktest';
+
+//转码完成后通知到你的业务服务器。
+$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
+$force = false;
+
+$config = new \Qiniu\Config();
+$config->useHTTPS = true;
+$pfop = new PersistentFop($auth, $config);
+
+//要进行视频截图操作
+$fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" .
+    \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_480x360.jpg");
+
+list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
+echo "\n====> pfop avthumb result: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    echo "PersistentFop Id: $id\n";
+}
+
+//查询转码的进度和状态
+list($ret, $err) = $pfop->status($id);
+echo "\n====> pfop avthumb status: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
+}

+ 47 - 0
vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php

@@ -0,0 +1,47 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+//对已经上传到七牛的视频发起异步转码操作
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+$bucket = getenv('QINIU_TEST_BUCKET');
+
+$auth = new Auth($accessKey, $secretKey);
+
+//要转码的文件所在的空间和文件名。
+$key = 'qiniu.mp4';
+
+//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
+$pipeline = 'sdktest';
+$force = false;
+
+//转码完成后通知到你的业务服务器。
+$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
+$config = new \Qiniu\Config();
+//$config->useHTTPS=true;
+
+$pfop = new PersistentFop($auth, $config);
+
+//要进行转码的转码操作。 http://developer.qiniu.com/docs/v6/api/reference/fop/av/avthumb.html
+$fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_640x360.mp4");
+
+list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
+echo "\n====> pfop avthumb result: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    echo "PersistentFop Id: $id\n";
+}
+
+//查询转码的进度和状态
+list($ret, $err) = $pfop->status($id);
+echo "\n====> pfop avthumb status: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
+}

+ 52 - 0
vendor/qiniu/php-sdk/examples/pfop_watermark.php

@@ -0,0 +1,52 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+//对已经上传到七牛的视频发起异步转码操作 
+
+$accessKey = getenv('QINIU_ACCESS_KEY');
+$secretKey = getenv('QINIU_SECRET_KEY');
+$bucket = getenv('QINIU_TEST_BUCKET');
+
+$auth = new Auth($accessKey, $secretKey);
+
+//要转码的文件所在的空间和文件名。
+$key = 'qiniu.mp4';
+
+//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
+$pipeline = 'sdktest';
+
+//转码完成后通知到你的业务服务器。
+$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
+$force = false;
+
+$config = new \Qiniu\Config();
+//$config->useHTTPS=true;
+$pfop = new PersistentFop($auth, $config);
+
+//需要添加水印的图片UrlSafeBase64
+//可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
+$base64URL = Qiniu\base64_urlSafeEncode('http://devtools.qiniu.com/qiniu.png');
+
+//水印参数
+$fops = "avthumb/mp4/s/640x360/vb/1.4m/image/" . $base64URL . "|saveas/"
+    . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_wm.mp4");
+
+list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
+echo "\n====> pfop avthumb result: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    echo "PersistentFop Id: $id\n";
+}
+
+//查询转码的进度和状态
+list($ret, $err) = $pfop->status($id);
+echo "\n====> pfop avthumb status: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
+}

BIN
vendor/qiniu/php-sdk/examples/php-logo.png


+ 29 - 0
vendor/qiniu/php-sdk/examples/prefop.php

@@ -0,0 +1,29 @@
+<?php
+require_once __DIR__ . '/../autoload.php';
+
+use Qiniu\Auth;
+use Qiniu\Processing\PersistentFop;
+
+$accessKey = 'Access_Key';
+$secretKey = 'Secret_Key';
+$auth = new Auth($accessKey, $secretKey);
+
+//要持久化处理的文件所在的空间和文件名。
+$bucket = 'Bucket_Name';
+
+//持久化处理使用的队列名称。 https://portal.qiniu.com/mps/pipeline
+$pipeline = 'pipeline_name';
+
+//持久化处理完成后通知到你的业务服务器。
+$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
+$pfop = new PersistentFop($auth, $bucket, $pipeline, $notifyUrl);
+
+$id = "z2.5955c739e3d0041bf80c9baa";
+//查询持久化处理的进度和状态
+list($ret, $err) = $pfop->status($id);
+echo "\n====> pfop avthumb status: \n";
+if ($err != null) {
+    var_dump($err);
+} else {
+    var_dump($ret);
+}

Some files were not shown because too many files changed in this diff