diff --git a/package/cos-sdk-v5-internal-6.phar b/package/cos-sdk-v5-internal-6.phar new file mode 100755 index 0000000..86f3b8f Binary files /dev/null and b/package/cos-sdk-v5-internal-6.phar differ diff --git a/package/cos-sdk-v5-internal-6.tar.gz b/package/cos-sdk-v5-internal-6.tar.gz new file mode 100644 index 0000000..3bf27b9 Binary files /dev/null and b/package/cos-sdk-v5-internal-6.tar.gz differ diff --git a/package/cos-sdk-v5-internal-7.phar b/package/cos-sdk-v5-internal-7.phar new file mode 100755 index 0000000..d409f73 Binary files /dev/null and b/package/cos-sdk-v5-internal-7.phar differ diff --git a/package/cos-sdk-v5-internal-7.tar.gz b/package/cos-sdk-v5-internal-7.tar.gz new file mode 100644 index 0000000..7af4810 Binary files /dev/null and b/package/cos-sdk-v5-internal-7.tar.gz differ diff --git a/sample/abortMultipartUpload.php b/sample/abortMultipartUpload.php index 0d8cf88..2275303 100644 --- a/sample/abortMultipartUpload.php +++ b/sample/abortMultipartUpload.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/appendObject.php b/sample/appendObject.php index 88ac654..76ed206 100644 --- a/sample/appendObject.php +++ b/sample/appendObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/blindWatermark.php b/sample/blindWatermark.php index e8252a3..e883a09 100644 --- a/sample/blindWatermark.php +++ b/sample/blindWatermark.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/catchException.php b/sample/catchException.php index 0c12f54..a9d6088 100644 --- a/sample/catchException.php +++ b/sample/catchException.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/ciTransformation.php b/sample/ciTransformation.php index 9dbab31..418d7e1 100644 --- a/sample/ciTransformation.php +++ b/sample/ciTransformation.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/completeMultipartUpload.php b/sample/completeMultipartUpload.php index 5950368..8a1b0d5 100644 --- a/sample/completeMultipartUpload.php +++ b/sample/completeMultipartUpload.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/copy.php b/sample/copy.php index f400dc3..e8979b0 100644 --- a/sample/copy.php +++ b/sample/copy.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/copyObject.php b/sample/copyObject.php index d58fc93..8eb7d94 100644 --- a/sample/copyObject.php +++ b/sample/copyObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/cosClient.php b/sample/cosClient.php index 4b68d1a..0aedae2 100644 --- a/sample/cosClient.php +++ b/sample/cosClient.php @@ -19,6 +19,7 @@ 'proxy' => '', //代理服务器 'retry' => 10, //重试次数 'userAgent' => '', //UA + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'allow_redirects' => false, //是否follow302 'credentials'=> array( 'secretId' => $secretId , diff --git a/sample/createBucket.php b/sample/createBucket.php index a2ed0d2..0a29c3b 100644 --- a/sample/createBucket.php +++ b/sample/createBucket.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createDocProcessJobs.php b/sample/createDocProcessJobs.php index ca8e654..6c3afd9 100644 --- a/sample/createDocProcessJobs.php +++ b/sample/createDocProcessJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createFolder.php b/sample/createFolder.php index 1d3b26d..cfc64ef 100644 --- a/sample/createFolder.php +++ b/sample/createFolder.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createMediaConcatJobs.php b/sample/createMediaConcatJobs.php index 090a449..2bc783b 100644 --- a/sample/createMediaConcatJobs.php +++ b/sample/createMediaConcatJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createMediaSnapshotJobs.php b/sample/createMediaSnapshotJobs.php index 16e0d90..5c9c745 100644 --- a/sample/createMediaSnapshotJobs.php +++ b/sample/createMediaSnapshotJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createMediaTranscodeJobs.php b/sample/createMediaTranscodeJobs.php index 3e97d24..5709bdf 100644 --- a/sample/createMediaTranscodeJobs.php +++ b/sample/createMediaTranscodeJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createMediaVoiceSeparateJobs.php b/sample/createMediaVoiceSeparateJobs.php index 1f16d59..73a401f 100644 --- a/sample/createMediaVoiceSeparateJobs.php +++ b/sample/createMediaVoiceSeparateJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/createMultipartUpload.php b/sample/createMultipartUpload.php index d81756f..2234cfc 100644 --- a/sample/createMultipartUpload.php +++ b/sample/createMultipartUpload.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucket.php b/sample/deleteBucket.php index 700cb87..a5b6a29 100644 --- a/sample/deleteBucket.php +++ b/sample/deleteBucket.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketCors.php b/sample/deleteBucketCors.php index c4ebd87..93cda05 100644 --- a/sample/deleteBucketCors.php +++ b/sample/deleteBucketCors.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketDomain.php b/sample/deleteBucketDomain.php index cbb5ba2..97452f2 100644 --- a/sample/deleteBucketDomain.php +++ b/sample/deleteBucketDomain.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketGuetzli.php b/sample/deleteBucketGuetzli.php index 5c00244..2f81712 100644 --- a/sample/deleteBucketGuetzli.php +++ b/sample/deleteBucketGuetzli.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketImageStyle.php b/sample/deleteBucketImageStyle.php index bc403a0..953c1ad 100644 --- a/sample/deleteBucketImageStyle.php +++ b/sample/deleteBucketImageStyle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketLifecycle.php b/sample/deleteBucketLifecycle.php index 69985d7..e765764 100644 --- a/sample/deleteBucketLifecycle.php +++ b/sample/deleteBucketLifecycle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketTagging.php b/sample/deleteBucketTagging.php index ce6ac23..b5fffb7 100644 --- a/sample/deleteBucketTagging.php +++ b/sample/deleteBucketTagging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBucketWebsite.php b/sample/deleteBucketWebsite.php index 2b6a300..9a0f11f 100644 --- a/sample/deleteBucketWebsite.php +++ b/sample/deleteBucketWebsite.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteBuckets.php b/sample/deleteBuckets.php index d7f1ba1..defb3ef 100644 --- a/sample/deleteBuckets.php +++ b/sample/deleteBuckets.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteFolder.php b/sample/deleteFolder.php index f771405..77d5bfd 100644 --- a/sample/deleteFolder.php +++ b/sample/deleteFolder.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteObject.php b/sample/deleteObject.php index 133667c..4d50167 100644 --- a/sample/deleteObject.php +++ b/sample/deleteObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/deleteObjectTagging.php b/sample/deleteObjectTagging.php index 2d1ad16..021202c 100644 --- a/sample/deleteObjectTagging.php +++ b/sample/deleteObjectTagging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectAudio.php b/sample/detectAudio.php index 5cba84f..aaf6245 100644 --- a/sample/detectAudio.php +++ b/sample/detectAudio.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectDocument.php b/sample/detectDocument.php index 5d84675..9eff7b4 100644 --- a/sample/detectDocument.php +++ b/sample/detectDocument.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectImage.php b/sample/detectImage.php index 58a21e9..a3f8c1c 100644 --- a/sample/detectImage.php +++ b/sample/detectImage.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/detectImages.php b/sample/detectImages.php index b35024a..c99b07d 100644 --- a/sample/detectImages.php +++ b/sample/detectImages.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/detectLable.php b/sample/detectLable.php index e0aa056..12264c3 100644 --- a/sample/detectLable.php +++ b/sample/detectLable.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectText.php b/sample/detectText.php index d8f6f12..f52d60d 100644 --- a/sample/detectText.php +++ b/sample/detectText.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectVideo.php b/sample/detectVideo.php index 5810fc6..4773f6f 100644 --- a/sample/detectVideo.php +++ b/sample/detectVideo.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectVirus.php b/sample/detectVirus.php index 5cc3747..cebe3d8 100644 --- a/sample/detectVirus.php +++ b/sample/detectVirus.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/detectWebpage.php b/sample/detectWebpage.php index cf38dbd..1eb34cc 100644 --- a/sample/detectWebpage.php +++ b/sample/detectWebpage.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/doesBucketExist.php b/sample/doesBucketExist.php index 9c5641d..b093a0c 100644 --- a/sample/doesBucketExist.php +++ b/sample/doesBucketExist.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/doesObjectExist.php b/sample/doesObjectExist.php index ff297c9..bf183ec 100644 --- a/sample/doesObjectExist.php +++ b/sample/doesObjectExist.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/download.php b/sample/download.php index f266e92..dac7063 100644 --- a/sample/download.php +++ b/sample/download.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/downloadFolder.php b/sample/downloadFolder.php index db91471..2712cbb 100644 --- a/sample/downloadFolder.php +++ b/sample/downloadFolder.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey diff --git a/sample/getBlindWatermark.php b/sample/getBlindWatermark.php index d300fe5..c1e877f 100644 --- a/sample/getBlindWatermark.php +++ b/sample/getBlindWatermark.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketAccelerate.php b/sample/getBucketAccelerate.php index bf4e1bc..8c8708b 100644 --- a/sample/getBucketAccelerate.php +++ b/sample/getBucketAccelerate.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketAcl.php b/sample/getBucketAcl.php index b37d93a..bf3357b 100644 --- a/sample/getBucketAcl.php +++ b/sample/getBucketAcl.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketCors.php b/sample/getBucketCors.php index 405b63b..8a0151b 100644 --- a/sample/getBucketCors.php +++ b/sample/getBucketCors.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketDomain.php b/sample/getBucketDomain.php index 6c74798..9fad557 100644 --- a/sample/getBucketDomain.php +++ b/sample/getBucketDomain.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketGuetzli.php b/sample/getBucketGuetzli.php index 145f331..ab72fd7 100644 --- a/sample/getBucketGuetzli.php +++ b/sample/getBucketGuetzli.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketImageStyle.php b/sample/getBucketImageStyle.php index 962c797..870bb4d 100644 --- a/sample/getBucketImageStyle.php +++ b/sample/getBucketImageStyle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketInventory.php b/sample/getBucketInventory.php index 87e78c5..38f390f 100644 --- a/sample/getBucketInventory.php +++ b/sample/getBucketInventory.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketLifecycle.php b/sample/getBucketLifecycle.php index 0552591..ccba9fa 100644 --- a/sample/getBucketLifecycle.php +++ b/sample/getBucketLifecycle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketLogging.php b/sample/getBucketLogging.php index 9b5b713..716319c 100644 --- a/sample/getBucketLogging.php +++ b/sample/getBucketLogging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketReferer.php b/sample/getBucketReferer.php index 48d52c5..2e9cc4c 100644 --- a/sample/getBucketReferer.php +++ b/sample/getBucketReferer.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/getBucketTagging.php b/sample/getBucketTagging.php index e89a40a..cd73b98 100644 --- a/sample/getBucketTagging.php +++ b/sample/getBucketTagging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getBucketWebsite.php b/sample/getBucketWebsite.php index 8a31f5b..1330a8d 100644 --- a/sample/getBucketWebsite.php +++ b/sample/getBucketWebsite.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDescribeDocProcessJob.php b/sample/getDescribeDocProcessJob.php index fbfaf01..64f832e 100644 --- a/sample/getDescribeDocProcessJob.php +++ b/sample/getDescribeDocProcessJob.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDescribeDocProcessJobs.php b/sample/getDescribeDocProcessJobs.php index c3c53d8..f5dd192 100644 --- a/sample/getDescribeDocProcessJobs.php +++ b/sample/getDescribeDocProcessJobs.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDescribeDocProcessQueues.php b/sample/getDescribeDocProcessQueues.php index 4dcb405..26127f1 100644 --- a/sample/getDescribeDocProcessQueues.php +++ b/sample/getDescribeDocProcessQueues.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDescribeMediaVoiceSeparateJob.php b/sample/getDescribeMediaVoiceSeparateJob.php index 3b5fc7e..1681353 100644 --- a/sample/getDescribeMediaVoiceSeparateJob.php +++ b/sample/getDescribeMediaVoiceSeparateJob.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectAudioResult.php b/sample/getDetectAudioResult.php index 5c418c9..123a451 100644 --- a/sample/getDetectAudioResult.php +++ b/sample/getDetectAudioResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectDocumentResult.php b/sample/getDetectDocumentResult.php index 6d72ada..f457e1b 100644 --- a/sample/getDetectDocumentResult.php +++ b/sample/getDetectDocumentResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectImageResult.php b/sample/getDetectImageResult.php index 00036ab..bcefbbd 100644 --- a/sample/getDetectImageResult.php +++ b/sample/getDetectImageResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectTextResult.php b/sample/getDetectTextResult.php index c98fae6..2b3cfa3 100644 --- a/sample/getDetectTextResult.php +++ b/sample/getDetectTextResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectVideoResult.php b/sample/getDetectVideoResult.php index a4c4d78..dd556ae 100644 --- a/sample/getDetectVideoResult.php +++ b/sample/getDetectVideoResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectVirusResult.php b/sample/getDetectVirusResult.php index 5c10a97..5f36fa3 100644 --- a/sample/getDetectVirusResult.php +++ b/sample/getDetectVirusResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getDetectWebpageResult.php b/sample/getDetectWebpageResult.php index cd79585..4f5530a 100644 --- a/sample/getDetectWebpageResult.php +++ b/sample/getDetectWebpageResult.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', // 审核时必须为https + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getMediaInfo.php b/sample/getMediaInfo.php index 28d328e..0a4892f 100644 --- a/sample/getMediaInfo.php +++ b/sample/getMediaInfo.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getObject.php b/sample/getObject.php index 6e7afda..7dad46e 100644 --- a/sample/getObject.php +++ b/sample/getObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getObjectTagging.php b/sample/getObjectTagging.php index 8bb6023..629c4a5 100644 --- a/sample/getObjectTagging.php +++ b/sample/getObjectTagging.php @@ -8,6 +8,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/getObjectUrl.php b/sample/getObjectUrl.php index 823cbfa..380db26 100644 --- a/sample/getObjectUrl.php +++ b/sample/getObjectUrl.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey diff --git a/sample/getObjectWithoutSign.php b/sample/getObjectWithoutSign.php index bc331f5..220ee65 100644 --- a/sample/getObjectWithoutSign.php +++ b/sample/getObjectWithoutSign.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/getPresignedUrl.php b/sample/getPresignedUrl.php index 147cf68..1c7c9bf 100644 --- a/sample/getPresignedUrl.php +++ b/sample/getPresignedUrl.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/getSnapshot.php b/sample/getSnapshot.php index 68d928f..801364a 100644 --- a/sample/getSnapshot.php +++ b/sample/getSnapshot.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/headBucket.php b/sample/headBucket.php index ff1fd48..ddbcdbc 100644 --- a/sample/headBucket.php +++ b/sample/headBucket.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/headObject.php b/sample/headObject.php index e5e8e8b..dfd0c76 100644 --- a/sample/headObject.php +++ b/sample/headObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageAve.php b/sample/imageAve.php index 892bbcb..a1a1131 100644 --- a/sample/imageAve.php +++ b/sample/imageAve.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageExif.php b/sample/imageExif.php index a9973ce..487af9f 100644 --- a/sample/imageExif.php +++ b/sample/imageExif.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageInfo.php b/sample/imageInfo.php index 3166578..ac47424 100644 --- a/sample/imageInfo.php +++ b/sample/imageInfo.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageMogr.php b/sample/imageMogr.php index 435c12e..5451e20 100644 --- a/sample/imageMogr.php +++ b/sample/imageMogr.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageProcess.php b/sample/imageProcess.php index 0b70b7e..01d28e1 100644 --- a/sample/imageProcess.php +++ b/sample/imageProcess.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageView.php b/sample/imageView.php index 7a9873c..acad0d9 100644 --- a/sample/imageView.php +++ b/sample/imageView.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/imageWatermark.php b/sample/imageWatermark.php index 14a0b23..2960ba8 100644 --- a/sample/imageWatermark.php +++ b/sample/imageWatermark.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/listBuckets.php b/sample/listBuckets.php index 3ed6de2..a961ddc 100644 --- a/sample/listBuckets.php +++ b/sample/listBuckets.php @@ -9,6 +9,8 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos + 'enableOldDomain' => true, 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/listMultipartUploads.php b/sample/listMultipartUploads.php index dc1050e..604b319 100644 --- a/sample/listMultipartUploads.php +++ b/sample/listMultipartUploads.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/listObjects.php b/sample/listObjects.php index 562a98b..0e90ffa 100644 --- a/sample/listObjects.php +++ b/sample/listObjects.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/listParts.php b/sample/listParts.php index d0c1053..a338769 100644 --- a/sample/listParts.php +++ b/sample/listParts.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/picOperations.php b/sample/picOperations.php index 5d419b6..22f43e3 100644 --- a/sample/picOperations.php +++ b/sample/picOperations.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBlindWatermark.php b/sample/putBlindWatermark.php index 872f9a9..e96a8f2 100644 --- a/sample/putBlindWatermark.php +++ b/sample/putBlindWatermark.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketAccelerate.php b/sample/putBucketAccelerate.php index 791631a..798d4ff 100644 --- a/sample/putBucketAccelerate.php +++ b/sample/putBucketAccelerate.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketAcl.php b/sample/putBucketAcl.php index 716ac8b..350d9ce 100644 --- a/sample/putBucketAcl.php +++ b/sample/putBucketAcl.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketCors.php b/sample/putBucketCors.php index 5ae60b5..e4aa58f 100644 --- a/sample/putBucketCors.php +++ b/sample/putBucketCors.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketDomain.php b/sample/putBucketDomain.php index 0431c4c..0e62356 100644 --- a/sample/putBucketDomain.php +++ b/sample/putBucketDomain.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketGuetzli.php b/sample/putBucketGuetzli.php index e7bcda4..bff1f2c 100644 --- a/sample/putBucketGuetzli.php +++ b/sample/putBucketGuetzli.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketImageStyle.php b/sample/putBucketImageStyle.php index 4df401b..8a02072 100644 --- a/sample/putBucketImageStyle.php +++ b/sample/putBucketImageStyle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketInventory.php b/sample/putBucketInventory.php index 8e6f48d..28975ed 100644 --- a/sample/putBucketInventory.php +++ b/sample/putBucketInventory.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketLifecycle.php b/sample/putBucketLifecycle.php index 8f3b963..286f97c 100644 --- a/sample/putBucketLifecycle.php +++ b/sample/putBucketLifecycle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketLogging.php b/sample/putBucketLogging.php index 0695959..36773ff 100644 --- a/sample/putBucketLogging.php +++ b/sample/putBucketLogging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketReferer.php b/sample/putBucketReferer.php index 1de0687..37f8aa0 100644 --- a/sample/putBucketReferer.php +++ b/sample/putBucketReferer.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials' => array( 'secretId' => $secretId, 'secretKey' => $secretKey))); diff --git a/sample/putBucketTagging.php b/sample/putBucketTagging.php index bf27b1e..5cde580 100644 --- a/sample/putBucketTagging.php +++ b/sample/putBucketTagging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putBucketWebsite.php b/sample/putBucketWebsite.php index 96afb28..57c4d9f 100644 --- a/sample/putBucketWebsite.php +++ b/sample/putBucketWebsite.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putImageStyle.php b/sample/putImageStyle.php index dfa021f..160f928 100644 --- a/sample/putImageStyle.php +++ b/sample/putImageStyle.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putObject.php b/sample/putObject.php index 56860c9..ed19529 100644 --- a/sample/putObject.php +++ b/sample/putObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putObjectTagging.php b/sample/putObjectTagging.php index 4fe22ed..9e2c2dd 100644 --- a/sample/putObjectTagging.php +++ b/sample/putObjectTagging.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/putQrcode.php b/sample/putQrcode.php index 1951ada..dc9d4ce 100644 --- a/sample/putQrcode.php +++ b/sample/putQrcode.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/qrcode.php b/sample/qrcode.php index 0f35466..f29358b 100644 --- a/sample/qrcode.php +++ b/sample/qrcode.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/qrcodeGenerate.php b/sample/qrcodeGenerate.php index 16fd8d5..a5b48c3 100644 --- a/sample/qrcodeGenerate.php +++ b/sample/qrcodeGenerate.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/restoreObject.php b/sample/restoreObject.php index cfe0880..ac804b4 100644 --- a/sample/restoreObject.php +++ b/sample/restoreObject.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/selectObjectContent.php b/sample/selectObjectContent.php index c9b8de2..470f55a 100644 --- a/sample/selectObjectContent.php +++ b/sample/selectObjectContent.php @@ -8,6 +8,7 @@ $cosClient = new Qcloud\Cos\Client(array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey diff --git a/sample/textWatermark.php b/sample/textWatermark.php index f8ef0a8..4d1d208 100644 --- a/sample/textWatermark.php +++ b/sample/textWatermark.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/trafficLimit.php b/sample/trafficLimit.php index 9bc8b1d..8cc31c9 100644 --- a/sample/trafficLimit.php +++ b/sample/trafficLimit.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/upload.php b/sample/upload.php index 1c92698..23b1e5d 100644 --- a/sample/upload.php +++ b/sample/upload.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/sample/uploadFolder.php b/sample/uploadFolder.php index 3885f7d..1a9b176 100644 --- a/sample/uploadFolder.php +++ b/sample/uploadFolder.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey diff --git a/sample/uploadPart.php b/sample/uploadPart.php index b1709cc..118de03 100644 --- a/sample/uploadPart.php +++ b/sample/uploadPart.php @@ -9,6 +9,7 @@ array( 'region' => $region, 'schema' => 'https', //协议头部,默认为http + 'endpoint' => ".cos-internal." . $region . ".tencentcos.cn", // 默认为内网域名,使用公网域名请修改cos-internal为cos 'credentials'=> array( 'secretId' => $secretId , 'secretKey' => $secretKey))); diff --git a/src/Client.php b/src/Client.php index c5c5f01..d5cec81 100644 --- a/src/Client.php +++ b/src/Client.php @@ -124,7 +124,7 @@ * @see \Qcloud\Cos\Service::getService() */ class Client extends GuzzleClient { - const VERSION = '2.5.2'; + const VERSION = '2.5.5'; public $httpClient; @@ -150,6 +150,7 @@ public function __construct(array $cosConfig) { $this->cosConfig['ip'] = isset($cosConfig['ip']) ? $cosConfig['ip'] : null; $this->cosConfig['port'] = isset($cosConfig['port']) ? $cosConfig['port'] : null; $this->cosConfig['endpoint'] = isset($cosConfig['endpoint']) ? $cosConfig['endpoint'] : null; + $this->cosConfig['endUri'] = isset($cosConfig['endUri']) ? $cosConfig['endUri'] : null; $this->cosConfig['domain'] = isset($cosConfig['domain']) ? $cosConfig['domain'] : null; $this->cosConfig['proxy'] = isset($cosConfig['proxy']) ? $cosConfig['proxy'] : null; $this->cosConfig['retry'] = isset($cosConfig['retry']) ? $cosConfig['retry'] : 1; @@ -158,6 +159,8 @@ public function __construct(array $cosConfig) { $this->cosConfig['signHost'] = isset($cosConfig['signHost']) ? $cosConfig['signHost'] : true; $this->cosConfig['allow_redirects'] = isset($cosConfig['allow_redirects']) ? $cosConfig['allow_redirects'] : false; $this->cosConfig['allow_accelerate'] = isset($cosConfig['allow_accelerate']) ? $cosConfig['allow_accelerate'] : false; + $this->cosConfig['enableOldDomain'] = isset($cosConfig['enableOldDomain']) ? $cosConfig['enableOldDomain'] : false; + $this->cosConfig['enableInternalDomain'] = isset($cosConfig['enableInternalDomain']) ? $cosConfig['enableInternalDomain'] : true; // check config $this->inputCheck(); @@ -179,8 +182,25 @@ public function __construct(array $cosConfig) { $handler->push($this::handleErrors()); $this->signature = new Signature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig, $this->cosConfig['token']); $area = $this->cosConfig['allow_accelerate'] ? 'accelerate' : $this->cosConfig['region']; + + $base_uri = $this->cosConfig['schema'].'://cos-internal.' . $area . '.tencentcos.cn/'; + + if ($this->cosConfig['endpoint'] != null) { + $base_uri = $this->cosConfig['schema'].'://' . $this->cosConfig['endpoint']; + } else if($this->cosConfig['ip'] != null) { + $base_uri = $this->cosConfig['ip']; + } else if($this->cosConfig['domain'] != null) { + $base_uri = $this->cosConfig['domain']; + } else if($this->cosConfig['enableOldDomain']) { + $base_uri = $this->cosConfig['schema'].'://cos.' . $area . '.myqcloud.com/'; + } else { + $base_uri = $this->cosConfig['enableInternalDomain'] ? + $this->cosConfig['schema'].'://cos-internal.' . $area . '.tencentcos.cn/' : + $this->cosConfig['schema'].'://cos.' . $area . '.tencentcos.cn/'; + } + $this->httpClient = new HttpClient([ - 'base_uri' => "{$this->cosConfig['schema']}://cos.{$area}.myqcloud.com/", + 'base_uri' => $base_uri, 'timeout' => $this->cosConfig['timeout'], 'handler' => $handler, 'proxy' => $this->cosConfig['proxy'], diff --git a/src/CommandToRequestTransformer.php b/src/CommandToRequestTransformer.php index ce5b970..792b743 100644 --- a/src/CommandToRequestTransformer.php +++ b/src/CommandToRequestTransformer.php @@ -22,20 +22,24 @@ public function __construct( $config, $operation ) { public function bucketStyleTransformer( CommandInterface $command, RequestInterface $request ) { $action = $command->getName(); if ($action == 'ListBuckets') { - $uri = "service.cos.myqcloud.com"; - - if ($this->config['endpoint'] != null) { - $uri = $this->config['endpoint']; - } + $uri = "service.cos.tencentcos.cn"; + + if ($this->config['endUri'] != null) { + $uri = "service.cos." . $this->config['endUri']; + } if ($this->config['domain'] != null) { $uri = $this->config['domain']; - } + } if ($this->config['ip'] != null) { $uri = $this->config['ip']; if ($this->config['port'] != null) { $uri = $this->config['ip'] . ":" . $this->config['port']; - } + } + } + if ($this->config['enableOldDomain']) { + $uri = "service.cos.myqcloud.com"; } + return $request->withUri(new Uri($this->config['schema']."://". $uri. "/")); } $operation = $this->operation; @@ -63,19 +67,29 @@ public function bucketStyleTransformer( CommandInterface $command, RequestInterf } } - if ($this->config['endpoint'] == null) { - $this->config['endpoint'] = "myqcloud.com"; + if ($this->config['endUri'] == null) { + if ($this->config['enableOldDomain']) { + $this->config['endUri'] = "myqcloud.com"; + } else { + $this->config['endUri'] = "tencentcos.cn"; + } + } + + $domain_type = '.cos-internal.'; + + if (!$this->config['enableInternalDomain']) { + $domain_type = '.cos.'; } - $domain_type = '.cos.'; if ($action == 'PutBucketImageStyle' || $action == 'GetBucketImageStyle' || $action == 'DeleteBucketImageStyle' || $action == 'PutBucketGuetzli' || $action == 'GetBucketGuetzli' || $action == 'DeleteBucketGuetzli') { $domain_type = '.pic.'; + $this->config['endUri'] = "myqcloud.com"; } $origin_host = $this->config['allow_accelerate'] ? - $bucketname . $domain_type . 'accelerate' . '.' . $this->config['endpoint'] : - $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint']; + $bucketname . $domain_type . 'accelerate' . '.' . $this->config['endUri'] : + $bucketname . $this->config['endpoint']; // domain if ( $this->config['domain'] != null ) { @@ -89,8 +103,11 @@ public function bucketStyleTransformer( CommandInterface $command, RequestInterf } } + + $path = $this->config['schema'].'://'. $host . $uri; $uri = new Uri( $path ); + $query = $request->getUri()->getQuery(); if ( $uri->getQuery() != $query && $uri->getQuery() != '' ) { $query = $uri->getQuery() . '&' . $request->getUri()->getQuery(); @@ -98,6 +115,7 @@ public function bucketStyleTransformer( CommandInterface $command, RequestInterf $uri = $uri->withQuery( $query ); $request = $request->withUri( $uri ); $request = $request->withHeader( 'Host', $origin_host ); + return $request; } @@ -124,173 +142,171 @@ public function uploadBodyTransformer( CommandInterface $command, $request, $bod } } - // update md5 + // update md5 - public function md5Transformer( CommandInterface $command, $request ) { - $operation = $this->operation; - if ( isset( $operation['data']['contentMd5'] ) ) { + public function md5Transformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $operation['data']['contentMd5'] ) ) { + $request = $this->addMd5( $request ); + } + if ( isset( $operation['parameters']['ContentMD5'] ) && + isset( $command['ContentMD5'] ) ) { + $value = $command['ContentMD5']; + if ( $value != false ) { $request = $this->addMd5( $request ); } - if ( isset( $operation['parameters']['ContentMD5'] ) && - isset( $command['ContentMD5'] ) ) { - $value = $command['ContentMD5']; - if ( $value != false ) { - $request = $this->addMd5( $request ); - } - } - - return $request; } - // add Query string - - public function queryStringTransformer( CommandInterface $command, $request ) { - $operation = $this->operation; - if ( isset( $command['Params'] ) ) { - $params = $command['Params']; - foreach ( $params as $key => $value ) { - $uri = $request->getUri(); - $query = $uri->getQuery(); - $uri = $uri->withQuery($query. "&" . urlencode($key) . "=" . $value ); - $request = $request->withUri( $uri ); - } - } - - return $request; - } + return $request; + } - // add Header string + // add Header string - public function headerTransformer( CommandInterface $command, $request ) { - $operation = $this->operation; - if ( isset( $command['Headers'] ) ) { - $headers = $command['Headers']; - foreach ( $headers as $key => $value ) { - $request = $request->withHeader( $key, $value); - } + public function headerTransformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $command['Headers'] ) ) { + $headers = $command['Headers']; + foreach ( $headers as $key => $value ) { + $request = $request->withHeader( $key, $value); } - return $request; } + return $request; + } - // add meta + // add Query string - public function metadataTransformer( CommandInterface $command, $request ) { - $operation = $this->operation; - if ( isset( $command['Metadata'] ) ) { - $meta = $command['Metadata']; - foreach ( $meta as $key => $value ) { - $request = $request->withHeader( 'x-cos-meta-' . $key, $value ); - } + public function queryStringTransformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $command['Params'] ) ) { + $params = $command['Params']; + foreach ( $params as $key => $value ) { + $uri = $request->getUri(); + $query = $uri->getQuery(); + $uri = $uri->withQuery($query. "&" . urlencode($key) . "=" . $value ); + $request = $request->withUri( $uri ); } - $request = headersMap( $command, $request ); - - return $request; } - // count md5 + return $request; + } + + // add meta - private function addMd5( $request ) { - $body = $request->getBody(); - if ( $body && $body->getSize() > 0 ) { - $md5 = base64_encode( md5( $body, true ) ); - return $request->withHeader( 'Content-MD5', $md5 ); + public function metadataTransformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $command['Metadata'] ) ) { + $meta = $command['Metadata']; + foreach ( $meta as $key => $value ) { + $request = $request->withHeader( 'x-cos-meta-' . $key, $value ); } - return $request; } + $request = headersMap( $command, $request ); - // inventoryId + return $request; + } - public function specialParamTransformer( CommandInterface $command, $request ) { - $action = $command->getName(); - if ( $action == 'PutBucketInventory' ) { - $id = $command['Id']; - $uri = $request->getUri(); - $query = $uri->getQuery(); - $uri = $uri->withQuery( $query . '&Id='.$id ); - return $request->withUri( $uri ); - } - return $request; + // count md5 + + private function addMd5( $request ) { + $body = $request->getBody(); + if ( $body && $body->getSize() > 0 ) { + $md5 = base64_encode( md5( $body, true ) ); + return $request->withHeader( 'Content-MD5', $md5 ); } + return $request; + } - public function ciParamTransformer( CommandInterface $command, $request ) { - $action = $command->getName(); - if ( $action == 'GetObject' ) { - if(str_contains($uri = $request->getUri(), '%21') ) { - $uri = new Uri( str_replace('%21', '!', $uri) ); - $request = $request->withUri( $uri ); - } - if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){ - $uri = $request->getUri(); - $query = $uri->getQuery(); - if($query){ - $query .= "&" . urlencode($command['ImageHandleParam']); - }else{ - $query .= urlencode($command['ImageHandleParam']); - } - $uri = $uri->withQuery($query); - $request = $request->withUri( $uri ); - } - } - return $request; + // inventoryId + + public function specialParamTransformer( CommandInterface $command, $request ) { + $action = $command->getName(); + if ( $action == 'PutBucketInventory' ) { + $id = $command['Id']; + $uri = $request->getUri(); + $query = $uri->getQuery(); + $uri = $uri->withQuery( $query . '&Id='.$id ); + return $request->withUri( $uri ); } + return $request; + } - public function cosDomain2CiTransformer(CommandInterface $command, $request) { - $action = $command->getName(); - $ciActions = array( - 'DetectText' => 1, - 'CreateMediaTranscodeJobs' => 1, - 'CreateMediaJobs' => 1, - 'DescribeMediaJob' => 1, - 'DescribeMediaJobs' => 1, - 'CreateMediaSnapshotJobs' => 1, - 'CreateMediaConcatJobs' => 1, - 'DetectAudio' => 1, - 'GetDetectAudioResult' => 1, - 'GetDetectTextResult' => 1, - 'DetectVideo' => 1, - 'GetDetectVideoResult' => 1, - 'DetectDocument' => 1, - 'GetDetectDocumentResult' => 1, - 'CreateDocProcessJobs' => 1, - 'DescribeDocProcessQueues' => 1, - 'DescribeDocProcessJob' => 1, - 'GetDescribeDocProcessJobs' => 1, - 'DetectImages' => 1, - 'GetDetectImageResult' => 1, - 'DetectVirus' => 1, - 'GetDetectVirusResult' => 1, - 'CreateMediaVoiceSeparateJobs' => 1, - 'DescribeMediaVoiceSeparateJob' => 1, - 'DetectWebpage' => 1, - 'GetDetectWebpageResult' => 1, - ); - if (key_exists($action, $ciActions)) { - $bucketname = $command['Bucket']; - $appId = $this->config['appId']; - if ( $appId != null && endWith( $bucketname, '-'.$appId ) == False ) { - $bucketname = $bucketname.'-'.$appId; - } - $command['Bucket'] = $bucketname; - $domain_type = '.ci.'; - $origin_host = $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint']; - $host = $origin_host; - if ( $this->config['ip'] != null ) { - $host = $this->config['ip']; - if ( $this->config['port'] != null ) { - $host = $this->config['ip'] . ':' . $this->config['port']; - } + public function ciParamTransformer( CommandInterface $command, $request ) { + $action = $command->getName(); + if ( $action == 'GetObject' ) { + if(str_contains($uri = $request->getUri(), '%21') ) { + $uri = new Uri( str_replace('%21', '!', $uri) ); + $request = $request->withUri( $uri ); + } + if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){ + $uri = $request->getUri(); + $query = $uri->getQuery(); + if($query){ + $query .= "&" . urlencode($command['ImageHandleParam']); + }else{ + $query .= urlencode($command['ImageHandleParam']); } - $path = $this->config['schema'].'://'. $host . $request->getUri()->getPath(); - $uri = new Uri( $path ); - $query = $request->getUri()->getQuery(); - $uri = $uri->withQuery( $query ); + $uri = $uri->withQuery($query); $request = $request->withUri( $uri ); - $request = $request->withHeader( 'Host', $origin_host ); } - return $request; } + return $request; + } - public function __destruct() { + public function cosDomain2CiTransformer(CommandInterface $command, $request) { + $action = $command->getName(); + $ciActions = array( + 'DetectText' => 1, + 'CreateMediaTranscodeJobs' => 1, + 'CreateMediaJobs' => 1, + 'DescribeMediaJob' => 1, + 'DescribeMediaJobs' => 1, + 'CreateMediaSnapshotJobs' => 1, + 'CreateMediaConcatJobs' => 1, + 'DetectAudio' => 1, + 'GetDetectAudioResult' => 1, + 'GetDetectTextResult' => 1, + 'DetectVideo' => 1, + 'GetDetectVideoResult' => 1, + 'DetectDocument' => 1, + 'GetDetectDocumentResult' => 1, + 'CreateDocProcessJobs' => 1, + 'DescribeDocProcessQueues' => 1, + 'DescribeDocProcessJob' => 1, + 'GetDescribeDocProcessJobs' => 1, + 'DetectImages' => 1, + 'GetDetectImageResult' => 1, + 'DetectVirus' => 1, + 'GetDetectVirusResult' => 1, + 'CreateMediaVoiceSeparateJobs' => 1, + 'DescribeMediaVoiceSeparateJob' => 1, + ); + if (key_exists($action, $ciActions)) { + $bucketname = $command['Bucket']; + $appId = $this->config['appId']; + if ( $appId != null && endWith( $bucketname, '-'.$appId ) == False ) { + $bucketname = $bucketname.'-'.$appId; + } + $command['Bucket'] = $bucketname; + $domain_type = '.ci.'; + $origin_host = $bucketname . $domain_type . $this->config['region'] . ".myqcloud.com"; + $host = $origin_host; + if ( $this->config['ip'] != null ) { + $host = $this->config['ip']; + if ( $this->config['port'] != null ) { + $host = $this->config['ip'] . ':' . $this->config['port']; + } + } + $path = $this->config['schema'].'://'. $host . $request->getUri()->getPath(); + $uri = new Uri( $path ); + $query = $request->getUri()->getQuery(); + $uri = $uri->withQuery( $query ); + $request = $request->withUri( $uri ); + $request = $request->withHeader( 'Host', $origin_host ); } + return $request; + } + public function __destruct() { } + +}