From 3190a12cfbcc334d9e86528123c3d52ecc7c1e46 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 26 Oct 2023 10:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cos-sdk-v5/.github/workflows/format.yml | 37 + .../cos-sdk-v5/.github/workflows/install.yml | 29 + vendor/qcloud/cos-sdk-v5/CHANGELOG.md | 262 + vendor/qcloud/cos-sdk-v5/LICENSE | 21 + vendor/qcloud/cos-sdk-v5/README.md | 302 + vendor/qcloud/cos-sdk-v5/composer.json | 56 + .../sample/abortMultipartUpload.php | 26 + .../qcloud/cos-sdk-v5/sample/appendObject.php | 36 + .../cos-sdk-v5/sample/blindWatermark.php | 31 + .../cos-sdk-v5/sample/catchException.php | 29 + .../cos-sdk-v5/sample/ciTransformation.php | 38 + .../sample/completeMultipartUpload.php | 36 + vendor/qcloud/cos-sdk-v5/sample/copy.php | 31 + .../qcloud/cos-sdk-v5/sample/copyObject.php | 27 + vendor/qcloud/cos-sdk-v5/sample/cosClient.php | 30 + .../qcloud/cos-sdk-v5/sample/createBucket.php | 24 + .../sample/createDocProcessJobs.php | 49 + .../qcloud/cos-sdk-v5/sample/createFolder.php | 26 + .../sample/createMediaConcatJobs.php | 95 + .../sample/createMediaSnapshotJobs.php | 70 + .../sample/createMediaTranscodeJobs.php | 164 + .../sample/createMediaVoiceSeparateJobs.php | 72 + .../sample/createMultipartUpload.php | 38 + .../qcloud/cos-sdk-v5/sample/deleteBucket.php | 24 + .../cos-sdk-v5/sample/deleteBucketCors.php | 24 + .../cos-sdk-v5/sample/deleteBucketDomain.php | 24 + .../cos-sdk-v5/sample/deleteBucketGuetzli.php | 24 + .../sample/deleteBucketImageStyle.php | 24 + .../sample/deleteBucketLifecycle.php | 24 + .../cos-sdk-v5/sample/deleteBucketTagging.php | 24 + .../cos-sdk-v5/sample/deleteBucketWebsite.php | 24 + .../cos-sdk-v5/sample/deleteBuckets.php | 52 + .../qcloud/cos-sdk-v5/sample/deleteFolder.php | 48 + .../qcloud/cos-sdk-v5/sample/deleteObject.php | 25 + .../cos-sdk-v5/sample/deleteObjectTagging.php | 25 + .../qcloud/cos-sdk-v5/sample/detectAudio.php | 54 + .../cos-sdk-v5/sample/detectDocument.php | 50 + .../qcloud/cos-sdk-v5/sample/detectImage.php | 47 + .../qcloud/cos-sdk-v5/sample/detectImages.php | 42 + .../qcloud/cos-sdk-v5/sample/detectLable.php | 25 + .../qcloud/cos-sdk-v5/sample/detectText.php | 71 + .../qcloud/cos-sdk-v5/sample/detectVideo.php | 64 + .../qcloud/cos-sdk-v5/sample/detectVirus.php | 44 + .../cos-sdk-v5/sample/detectWebpage.php | 33 + .../cos-sdk-v5/sample/doesBucketExist.php | 24 + .../cos-sdk-v5/sample/doesObjectExist.php | 25 + vendor/qcloud/cos-sdk-v5/sample/download.php | 38 + .../cos-sdk-v5/sample/downloadFolder.php | 52 + .../cos-sdk-v5/sample/getBlindWatermark.php | 35 + .../cos-sdk-v5/sample/getBucketAccelerate.php | 24 + .../qcloud/cos-sdk-v5/sample/getBucketAcl.php | 24 + .../cos-sdk-v5/sample/getBucketCors.php | 24 + .../cos-sdk-v5/sample/getBucketDomain.php | 24 + .../cos-sdk-v5/sample/getBucketGuetzli.php | 24 + .../cos-sdk-v5/sample/getBucketImageStyle.php | 25 + .../cos-sdk-v5/sample/getBucketInventory.php | 25 + .../cos-sdk-v5/sample/getBucketLifecycle.php | 24 + .../cos-sdk-v5/sample/getBucketLogging.php | 24 + .../cos-sdk-v5/sample/getBucketReferer.php | 25 + .../cos-sdk-v5/sample/getBucketTagging.php | 24 + .../cos-sdk-v5/sample/getBucketWebsite.php | 24 + .../sample/getDescribeDocProcessJob.php | 25 + .../sample/getDescribeDocProcessJobs.php | 32 + .../sample/getDescribeDocProcessQueues.php | 24 + .../getDescribeMediaVoiceSeparateJob.php | 25 + .../sample/getDetectAudioResult.php | 25 + .../sample/getDetectDocumentResult.php | 25 + .../sample/getDetectImageResult.php | 25 + .../cos-sdk-v5/sample/getDetectTextResult.php | 25 + .../sample/getDetectVideoResult.php | 25 + .../sample/getDetectVirusResult.php | 25 + .../sample/getDetectWebpageResult.php | 25 + .../qcloud/cos-sdk-v5/sample/getMediaInfo.php | 29 + vendor/qcloud/cos-sdk-v5/sample/getObject.php | 35 + .../getObjectSensitiveContentRecognition.php | 52 + .../cos-sdk-v5/sample/getObjectTagging.php | 24 + .../qcloud/cos-sdk-v5/sample/getObjectUrl.php | 40 + .../sample/getObjectWithoutSign.php | 26 + .../cos-sdk-v5/sample/getPresignedUrl.php | 30 + .../qcloud/cos-sdk-v5/sample/getSnapshot.php | 41 + .../qcloud/cos-sdk-v5/sample/headBucket.php | 25 + .../qcloud/cos-sdk-v5/sample/headObject.php | 25 + vendor/qcloud/cos-sdk-v5/sample/imageAve.php | 25 + vendor/qcloud/cos-sdk-v5/sample/imageExif.php | 25 + vendor/qcloud/cos-sdk-v5/sample/imageInfo.php | 25 + vendor/qcloud/cos-sdk-v5/sample/imageMogr.php | 30 + .../qcloud/cos-sdk-v5/sample/imageProcess.php | 31 + vendor/qcloud/cos-sdk-v5/sample/imageView.php | 32 + .../cos-sdk-v5/sample/imageWatermark.php | 33 + .../qcloud/cos-sdk-v5/sample/listBuckets.php | 23 + .../sample/listMultipartUploads.php | 30 + .../qcloud/cos-sdk-v5/sample/listObjects.php | 29 + vendor/qcloud/cos-sdk-v5/sample/listParts.php | 28 + .../cos-sdk-v5/sample/picOperations.php | 33 + .../cos-sdk-v5/sample/putBlindWatermark.php | 34 + .../cos-sdk-v5/sample/putBucketAccelerate.php | 25 + .../qcloud/cos-sdk-v5/sample/putBucketAcl.php | 39 + .../cos-sdk-v5/sample/putBucketCors.php | 32 + .../cos-sdk-v5/sample/putBucketDomain.php | 33 + .../cos-sdk-v5/sample/putBucketGuetzli.php | 24 + .../cos-sdk-v5/sample/putBucketImageStyle.php | 26 + .../cos-sdk-v5/sample/putBucketInventory.php | 45 + .../cos-sdk-v5/sample/putBucketLifecycle.php | 44 + .../cos-sdk-v5/sample/putBucketLogging.php | 28 + .../cos-sdk-v5/sample/putBucketReferer.php | 35 + .../cos-sdk-v5/sample/putBucketTagging.php | 32 + .../cos-sdk-v5/sample/putBucketWebsite.php | 46 + .../cos-sdk-v5/sample/putImageStyle.php | 33 + vendor/qcloud/cos-sdk-v5/sample/putObject.php | 48 + .../cos-sdk-v5/sample/putObjectTagging.php | 33 + vendor/qcloud/cos-sdk-v5/sample/putQrcode.php | 33 + vendor/qcloud/cos-sdk-v5/sample/qrcode.php | 26 + .../cos-sdk-v5/sample/qrcodeGenerate.php | 27 + .../cos-sdk-v5/sample/restoreObject.php | 29 + .../cos-sdk-v5/sample/selectObjectContent.php | 85 + .../cos-sdk-v5/sample/textWatermark.php | 31 + .../qcloud/cos-sdk-v5/sample/trafficLimit.php | 40 + vendor/qcloud/cos-sdk-v5/sample/upload.php | 56 + .../qcloud/cos-sdk-v5/sample/uploadFolder.php | 42 + .../qcloud/cos-sdk-v5/sample/uploadPart.php | 30 + vendor/qcloud/cos-sdk-v5/src/Client.php | 490 ++ .../src/CommandToRequestTransformer.php | 296 + vendor/qcloud/cos-sdk-v5/src/Common.php | 69 + vendor/qcloud/cos-sdk-v5/src/Copy.php | 140 + vendor/qcloud/cos-sdk-v5/src/Descriptions.php | 4963 ++++++++++++ .../cos-sdk-v5/src/Exception/CosException.php | 5 + .../Exception/ServiceResponseException.php | 189 + .../cos-sdk-v5/src/ExceptionMiddleware.php | 71 + .../qcloud/cos-sdk-v5/src/ExceptionParser.php | 112 + .../BlindWatermarkTemplate.php | 87 + .../CIParamTransformation.php | 39 + .../ImageParamTemplate/ImageMogrTemplate.php | 159 + .../ImageQrcodeTemplate.php | 37 + .../ImageParamTemplate/ImageStyleTemplate.php | 33 + .../src/ImageParamTemplate/ImageTemplate.php | 18 + .../ImageParamTemplate/ImageViewTemplate.php | 106 + .../ImageWatermarkTemplate.php | 122 + .../PicOperationsTransformation.php | 60 + .../TextWatermarkTemplate.php | 166 + .../qcloud/cos-sdk-v5/src/MultipartUpload.php | 167 + .../qcloud/cos-sdk-v5/src/RangeDownload.php | 145 + .../cos-sdk-v5/src/Request/BodyLocation.php | 49 + .../cos-sdk-v5/src/ResultTransformer.php | 187 + vendor/qcloud/cos-sdk-v5/src/Serializer.php | 81 + vendor/qcloud/cos-sdk-v5/src/Service.php | 7072 +++++++++++++++++ vendor/qcloud/cos-sdk-v5/src/Signature.php | 131 + .../cos-sdk-v5/src/SignatureMiddleware.php | 23 + .../php-sdk/.github/workflows/test-ci.yml | 44 + vendor/qiniu/php-sdk/.gitignore | 12 + vendor/qiniu/php-sdk/.scrutinizer.yml | 42 + vendor/qiniu/php-sdk/CHANGELOG.md | 147 + vendor/qiniu/php-sdk/CONTRIBUTING.md | 30 + vendor/qiniu/php-sdk/LICENSE | 22 + vendor/qiniu/php-sdk/README.md | 76 + vendor/qiniu/php-sdk/autoload.php | 18 + vendor/qiniu/php-sdk/composer.json | 37 + vendor/qiniu/php-sdk/examples/README.md | 10 + .../php-sdk/examples/bucket_lifecycleRule.php | 40 + .../php-sdk/examples/cdn_get_bandwidth.php | 41 + .../qiniu/php-sdk/examples/cdn_get_flux.php | 35 + .../php-sdk/examples/cdn_get_log_list.php | 31 + .../examples/cdn_get_prefetch_list.php | 46 + .../php-sdk/examples/cdn_get_refresh_list.php | 48 + .../examples/cdn_refresh_urls_dirs.php | 59 + .../examples/cdn_timestamp_antileech.php | 20 + .../qiniu/php-sdk/examples/censor_image.php | 42 + .../qiniu/php-sdk/examples/censor_video.php | 52 + .../qiniu/php-sdk/examples/delete_bucket.php | 27 + .../php-sdk/examples/delete_bucketEvent.php | 28 + .../examples/delete_bucketLifecycleRule.php | 27 + .../php-sdk/examples/get_bucketEvents.php | 26 + .../examples/get_bucketLifecycleRules.php | 26 + .../qiniu/php-sdk/examples/get_bucketList.php | 26 + .../php-sdk/examples/get_bucketQuota.php | 26 + .../qiniu/php-sdk/examples/get_bucketinfo.php | 25 + .../php-sdk/examples/get_bucketinfos.php | 26 + .../qiniu/php-sdk/examples/get_corsRules.php | 26 + .../php-sdk/examples/image_url_builder.php | 74 + .../php-sdk/examples/persistent_fop_init.php | 18 + .../examples/persistent_fop_status.php | 19 + vendor/qiniu/php-sdk/examples/pfop_mkzip.php | 58 + vendor/qiniu/php-sdk/examples/pfop_vframe.php | 55 + .../php-sdk/examples/pfop_video_avthumb.php | 55 + .../qiniu/php-sdk/examples/pfop_watermark.php | 59 + vendor/qiniu/php-sdk/examples/php-logo.png | Bin 0 -> 65062 bytes vendor/qiniu/php-sdk/examples/prefop.php | 27 + .../php-sdk/examples/put_bucketAccessMode.php | 27 + .../examples/put_bucketAccessStyleMode.php | 27 + .../php-sdk/examples/put_bucketEvent.php | 32 + .../php-sdk/examples/put_bucketMaxAge.php | 27 + .../php-sdk/examples/put_bucketQuota.php | 29 + .../php-sdk/examples/put_referAntiLeech.php | 30 + vendor/qiniu/php-sdk/examples/qetag.php | 14 + .../php-sdk/examples/rs_asynch_fetch.php | 71 + .../php-sdk/examples/rs_batch_change_mime.php | 32 + .../php-sdk/examples/rs_batch_change_type.php | 44 + .../qiniu/php-sdk/examples/rs_batch_copy.php | 40 + .../php-sdk/examples/rs_batch_delete.php | 32 + .../examples/rs_batch_delete_after_days.php | 39 + .../qiniu/php-sdk/examples/rs_batch_move.php | 40 + .../php-sdk/examples/rs_batch_restore_ar.php | 41 + .../qiniu/php-sdk/examples/rs_batch_stat.php | 32 + .../php-sdk/examples/rs_bucket_domains.php | 26 + vendor/qiniu/php-sdk/examples/rs_buckets.php | 25 + .../qiniu/php-sdk/examples/rs_change_mime.php | 29 + .../php-sdk/examples/rs_change_status.php | 29 + .../qiniu/php-sdk/examples/rs_change_type.php | 31 + vendor/qiniu/php-sdk/examples/rs_copy.php | 33 + vendor/qiniu/php-sdk/examples/rs_delete.php | 27 + .../php-sdk/examples/rs_delete_after_days.php | 26 + .../php-sdk/examples/rs_download_urls.php | 19 + vendor/qiniu/php-sdk/examples/rs_fetch.php | 43 + vendor/qiniu/php-sdk/examples/rs_move.php | 29 + vendor/qiniu/php-sdk/examples/rs_prefetch.php | 25 + vendor/qiniu/php-sdk/examples/rs_restore.php | 28 + vendor/qiniu/php-sdk/examples/rs_stat.php | 28 + .../php-sdk/examples/rsf_list_bucket.php | 47 + .../qiniu/php-sdk/examples/rsf_list_files.php | 39 + .../php-sdk/examples/rsf_v2list_bucket.php | 34 + vendor/qiniu/php-sdk/examples/rtc/README.md | 34 + .../php-sdk/examples/rtc/rtc_createApp.php | 32 + .../examples/rtc/rtc_create_roomToken.php | 34 + .../php-sdk/examples/rtc/rtc_deleteApp.php | 25 + .../qiniu/php-sdk/examples/rtc/rtc_getApp.php | 26 + .../examples/rtc/rtc_rooms_kickUser.php | 31 + .../rtc/rtc_rooms_listActiveRooms.php | 35 + .../examples/rtc/rtc_rooms_listUser.php | 29 + .../examples/rtc/rtc_rooms_stopMerge.php | 28 + .../php-sdk/examples/rtc/rtc_updateApp.php | 40 + vendor/qiniu/php-sdk/examples/saveas.php | 33 + vendor/qiniu/php-sdk/examples/sms/README.md | 45 + .../examples/sms/sms_create_signature.php | 29 + .../examples/sms/sms_create_template.php | 33 + .../examples/sms/sms_delete_signature.php | 25 + .../examples/sms/sms_delete_template.php | 25 + .../examples/sms/sms_edit_signature.php | 30 + .../examples/sms/sms_edit_template.php | 31 + .../examples/sms/sms_query_send_sms.php | 50 + .../examples/sms/sms_query_signature.php | 28 + .../sms/sms_query_single_signature.php | 26 + .../sms/sms_query_single_template.php | 26 + .../examples/sms/sms_query_template.php | 28 + .../php-sdk/examples/sms/sms_send_message.php | 32 + .../php-sdk/examples/update_bucketEvent.php | 31 + .../examples/update_bucketLifecycleRule.php | 36 + .../php-sdk/examples/upload_and_callback.php | 31 + .../php-sdk/examples/upload_and_pfop.php | 49 + .../php-sdk/examples/upload_mgr_init.php | 19 + .../php-sdk/examples/upload_multi_demos.php | 89 + .../php-sdk/examples/upload_simple_file.php | 37 + .../qiniu/php-sdk/examples/upload_tokens.php | 82 + .../examples/upload_verify_callback.php | 34 + .../php-sdk/examples/upload_with_qvmzone.php | 40 + .../php-sdk/examples/upload_with_zone.php | 39 + vendor/qiniu/php-sdk/phpunit.xml.dist | 18 + vendor/qiniu/php-sdk/src/Qiniu/Auth.php | 231 + .../php-sdk/src/Qiniu/Cdn/CdnManager.php | 260 + vendor/qiniu/php-sdk/src/Qiniu/Config.php | 146 + .../php-sdk/src/Qiniu/Enum/QiniuEnum.php | 41 + .../src/Qiniu/Enum/SplitUploadVersion.php | 9 + vendor/qiniu/php-sdk/src/Qiniu/Etag.php | 76 + .../qiniu/php-sdk/src/Qiniu/Http/Client.php | 140 + vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php | 35 + .../qiniu/php-sdk/src/Qiniu/Http/Header.php | 280 + .../qiniu/php-sdk/src/Qiniu/Http/Request.php | 18 + .../qiniu/php-sdk/src/Qiniu/Http/Response.php | 212 + .../src/Qiniu/Processing/ImageUrlBuilder.php | 292 + .../src/Qiniu/Processing/Operation.php | 60 + .../src/Qiniu/Processing/PersistentFop.php | 94 + vendor/qiniu/php-sdk/src/Qiniu/Region.php | 196 + .../qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php | 234 + vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php | 380 + .../src/Qiniu/Storage/ArgusManager.php | 123 + .../src/Qiniu/Storage/BucketManager.php | 1110 +++ .../src/Qiniu/Storage/FormUploader.php | 149 + .../src/Qiniu/Storage/ResumeUploader.php | 422 + .../src/Qiniu/Storage/UploadManager.php | 154 + vendor/qiniu/php-sdk/src/Qiniu/Zone.php | 47 + vendor/qiniu/php-sdk/src/Qiniu/functions.php | 281 + vendor/qiniu/php-sdk/test-env.sh | 4 + .../php-sdk/tests/Qiniu/Tests/AuthTest.php | 211 + .../php-sdk/tests/Qiniu/Tests/Base64Test.php | 14 + .../php-sdk/tests/Qiniu/Tests/BucketTest.php | 598 ++ .../tests/Qiniu/Tests/CdnManagerTest.php | 146 + .../php-sdk/tests/Qiniu/Tests/ConfigTest.php | 45 + .../php-sdk/tests/Qiniu/Tests/Crc32Test.php | 21 + .../tests/Qiniu/Tests/DownloadTest.php | 25 + .../php-sdk/tests/Qiniu/Tests/EtagTest.php | 52 + .../php-sdk/tests/Qiniu/Tests/FopTest.php | 37 + .../php-sdk/tests/Qiniu/Tests/FormUpTest.php | 76 + .../php-sdk/tests/Qiniu/Tests/HeaderTest.php | 167 + .../php-sdk/tests/Qiniu/Tests/HttpTest.php | 79 + .../tests/Qiniu/Tests/ImageUrlBuilderTest.php | 261 + .../php-sdk/tests/Qiniu/Tests/PfopTest.php | 66 + .../tests/Qiniu/Tests/ResumeUpTest.php | 312 + .../php-sdk/tests/Qiniu/Tests/ZoneTest.php | 125 + vendor/qiniu/php-sdk/tests/bootstrap.php | 61 + vendor/ralouphie/getallheaders/LICENSE | 21 + vendor/ralouphie/getallheaders/README.md | 27 + vendor/ralouphie/getallheaders/composer.json | 26 + .../getallheaders/src/getallheaders.php | 46 + 301 files changed, 30916 insertions(+) create mode 100644 vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml create mode 100644 vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml create mode 100644 vendor/qcloud/cos-sdk-v5/CHANGELOG.md create mode 100644 vendor/qcloud/cos-sdk-v5/LICENSE create mode 100644 vendor/qcloud/cos-sdk-v5/README.md create mode 100644 vendor/qcloud/cos-sdk-v5/composer.json create mode 100644 vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/appendObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/catchException.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/copy.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/copyObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/cosClient.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createBucket.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectAudio.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectDocument.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectImage.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectImages.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectLable.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectText.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectVideo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectVirus.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/download.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/headBucket.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/headObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageAve.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageExif.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageInfo.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageMogr.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageProcess.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageView.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/listBuckets.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/listObjects.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/listParts.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/picOperations.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/putQrcode.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/qrcode.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/restoreObject.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/textWatermark.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/upload.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php create mode 100644 vendor/qcloud/cos-sdk-v5/sample/uploadPart.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Client.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Common.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Copy.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Descriptions.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Exception/ServiceResponseException.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageViewTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/RangeDownload.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Serializer.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Service.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/Signature.php create mode 100644 vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php create mode 100644 vendor/qiniu/php-sdk/.github/workflows/test-ci.yml create mode 100644 vendor/qiniu/php-sdk/.gitignore create mode 100644 vendor/qiniu/php-sdk/.scrutinizer.yml create mode 100644 vendor/qiniu/php-sdk/CHANGELOG.md create mode 100644 vendor/qiniu/php-sdk/CONTRIBUTING.md create mode 100644 vendor/qiniu/php-sdk/LICENSE create mode 100644 vendor/qiniu/php-sdk/README.md create mode 100644 vendor/qiniu/php-sdk/autoload.php create mode 100644 vendor/qiniu/php-sdk/composer.json create mode 100644 vendor/qiniu/php-sdk/examples/README.md create mode 100644 vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_flux.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_log_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php create mode 100644 vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php create mode 100644 vendor/qiniu/php-sdk/examples/censor_image.php create mode 100644 vendor/qiniu/php-sdk/examples/censor_video.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketEvents.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketList.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketQuota.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketinfo.php create mode 100644 vendor/qiniu/php-sdk/examples/get_bucketinfos.php create mode 100644 vendor/qiniu/php-sdk/examples/get_corsRules.php create mode 100644 vendor/qiniu/php-sdk/examples/image_url_builder.php create mode 100644 vendor/qiniu/php-sdk/examples/persistent_fop_init.php create mode 100644 vendor/qiniu/php-sdk/examples/persistent_fop_status.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_mkzip.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_vframe.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php create mode 100644 vendor/qiniu/php-sdk/examples/pfop_watermark.php create mode 100644 vendor/qiniu/php-sdk/examples/php-logo.png create mode 100644 vendor/qiniu/php-sdk/examples/prefop.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php create mode 100644 vendor/qiniu/php-sdk/examples/put_bucketQuota.php create mode 100644 vendor/qiniu/php-sdk/examples/put_referAntiLeech.php create mode 100644 vendor/qiniu/php-sdk/examples/qetag.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_asynch_fetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_change_type.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_copy.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_delete.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_move.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_batch_stat.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_bucket_domains.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_buckets.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_mime.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_status.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_change_type.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_copy.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_delete.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_delete_after_days.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_download_urls.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_fetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_move.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_prefetch.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_restore.php create mode 100644 vendor/qiniu/php-sdk/examples/rs_stat.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_list_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_list_files.php create mode 100644 vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/README.md create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php create mode 100644 vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php create mode 100644 vendor/qiniu/php-sdk/examples/saveas.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/README.md create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_create_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_query_template.php create mode 100644 vendor/qiniu/php-sdk/examples/sms/sms_send_message.php create mode 100644 vendor/qiniu/php-sdk/examples/update_bucketEvent.php create mode 100644 vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_and_callback.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_and_pfop.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_mgr_init.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_multi_demos.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_simple_file.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_tokens.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_verify_callback.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php create mode 100644 vendor/qiniu/php-sdk/examples/upload_with_zone.php create mode 100644 vendor/qiniu/php-sdk/phpunit.xml.dist create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Auth.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Config.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Enum/SplitUploadVersion.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Etag.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Region.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/Zone.php create mode 100644 vendor/qiniu/php-sdk/src/Qiniu/functions.php create mode 100644 vendor/qiniu/php-sdk/test-env.sh create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php create mode 100644 vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php create mode 100644 vendor/qiniu/php-sdk/tests/bootstrap.php create mode 100644 vendor/ralouphie/getallheaders/LICENSE create mode 100644 vendor/ralouphie/getallheaders/README.md create mode 100644 vendor/ralouphie/getallheaders/composer.json create mode 100644 vendor/ralouphie/getallheaders/src/getallheaders.php diff --git a/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml b/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml new file mode 100644 index 0000000..c1dced7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/.github/workflows/format.yml @@ -0,0 +1,37 @@ +name: format + +on: + push: + pull_request: + +jobs: + format: + name: Format Code + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest] + php-version: ['8.0'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Setup Dependencies + run: + composer install -o + + - name: Run + run: | + php bin/format + php bin/release + + - name: Commit Updated + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Format code diff --git a/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml b/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml new file mode 100644 index 0000000..6eb3a6f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/.github/workflows/install.yml @@ -0,0 +1,29 @@ +name: Support Multiple Versions + +on: + push: + pull_request: + +jobs: + install: + name: PHP${{ matrix.php-version }} Test Install + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest] + php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + max-parallel: 10 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Setup Dependencies + run: + composer install -o diff --git a/vendor/qcloud/cos-sdk-v5/CHANGELOG.md b/vendor/qcloud/cos-sdk-v5/CHANGELOG.md new file mode 100644 index 0000000..fc9083d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/CHANGELOG.md @@ -0,0 +1,262 @@ +cos-php-sdk-v5 Upgrade Guide +==================== +2.5.2 to 2.5.3 +--------- +- 增加ETag的兼容逻辑,防止因为特殊框架或者网关规则导致etag undefined + +2.5.1 to 2.5.2 +--------- +- 修复预签名中Headers参数无效的问题 + +2.5.0 to 2.5.1 +--------- +- 万象相关接口的DetectType审核类型参数可选 +- 万象内容审核接口增加DataId自定义业务标识 +- 新增万象网页审核任务相关接口 +- 新增部分参数校验 +- 修复PHP8.1中将null传递给不可为空的内部函数的问题 + +2.4.4 to 2.5.0 +--------- +- 万象支持病毒检测、人声分离任务接口 +- 万象转码任务支持多个水印参数/多任务接口/查询接口/列表接口 +- 修复签名长期存在的bug +- 修复copy接口404问题,copyObject示例添加注释 +- 审核接口增加仅支持https的说明 + +2.4.3 to 2.4.4 +--------- +- 修复图片水印签名问题 + +2.4.2 to 2.4.3 +--------- +- 优化审核接口返回相关字段 +- 增加host开关功能 +- GetObject接口支持万象自定义样式 +- 修复ip的host bug + +2.4.1 to 2.4.2 +--------- +- 修复图片处理相关接口403签名不对的bug + +2.4.0 to 2.4.1 +--------- +- 增加桶Bucket、GetBucket对应Sample详细注解 +- 对部分传入参数进行检查 +- 添加doesObjectExist、doesBucketExist对应Sample +- 调整整体项目架构,修复composer依赖问题 +- 调整UT + +2.3.4 to 2.4.0 +--------- +- 新增文档转码功能,包括提交、查询、拉取文档预览任务 +- 丰富头域参数说明 +- 修复预签名中将万象参数作为key报错问题 +- 调整travis与action,后续版本保证多版本测试正常 + +2.3.3 to 2.3.4 +--------- +- 修复laravel8中guzzlehttp/psr7报错问题,后续重新整理依赖 +- 修复putBucketAccelerate接口与目前API不一致的问题 + +2.3.2 to 2.3.3 +--------- +- 修复laravel8中guzzlehttp/psr7报错问题 +- 清理无用代码 + +2.3.1 to 2.3.2 +--------- +- 新增视频截帧,视频信息查询示例 +- 新增PUT/GET Bucket Referer示例 +- 对于相应接口添加CRC返回信息 +- 修复图片审核中ci-process param出现两次的问题 +- 修复PHP5.6 版本的依赖问题 +- 根据PHP版本自动composer install guzzle6.x或guzzle7 + +2.3.0 to 2.3.1 +--------- +- 修复文本检测的返回格式 +- 修复sample中的问题 +- 新增视频、文本、文档、音频检测 +- 新增媒体转码、截图、拼接 + +2.2.3 to 2.3.0 +--------- +- 新增图片审核,视频审核,音频审核,文本审核,文档审核接口 +- 新增单链接限速demo +- 暴露getPresigned接口Headers和Params参数接口 +- 补充textDetect UT +- 修复stream_for废弃问题 +- 修复x-cos头检测逻辑问题 +- 修复UT部分bug + +2.2.2 to 2.2.3 +- 在putObejct中新增x-cos-tagging头 +- 修复`GetObjectWithoutSign`bug + +2.2.1 to 2.2.2 +---------- +新增appendObject SDK,包括sample,service,test +增加无签名对象下载地址 SDK,包括sample,service,test +增加全球加速相关配置参数 +将COS_SECRETID修改为SECRETID、COS_SECRETKEY修改为SECRETKEY,防止混淆 +修复部分逻辑代码bug +修复部分拼写错误 +- Add `AppendObject` interface +- Add `GetObjectWithoutSign` interface +- Add `allow_accelerate` param to client +- Change const name `COS_SECRETID->SECRETID` `COS_SECRETKEY->SECRETKEY` +- Fix `getPresigned` interface +- Fix typo + +2.2.0 to 2.2.1 +---------- +- Add `PutObjectTagging` interface +- Add `GetObjectTagging` interface +- Add `DeleteObjectTagging` interface + +2.1.6 to 2.2.0 +---------- +- `PutObject` interface supports ci image process +- `GetObject` interface supports ci image process +- Add `ImageInfo` interface, which is used for get image info +- Add `ImageExif` interface, which is used for get image exif +- Add `ImageAve` interface, which is used for get image ave +- Add `ImageProcess` interface, which is used for data processing on cloud +- Add `Qrcode` interface, which is used for qrcode recognition +- Add `QrcodeGenerate` interface, which is used for generate qrcode +- Add `DetectLabel` interface, which is used for detect image label +- Add `PutBucketImageStyle` interface, which is used for add bucket image style +- Add `GetBucketImageStyle` interface, which is used for get bucket image style +- Add `DeleteBucketImageStyle` interface, which is used for delete bucket image style +- Add `PutBucketGuetzli` interface, which is used for open bucket guetzli state +- Add `GetBucketGuetzli` interface, which is used for get bucket guetzli state +- Add `DeleteBucketGuetzli` interface, which is used for close bucket guetzli state + +2.1.5 to 2.1.6 +---------- +- Add `allow_redirects` parameter +- Fix `selectObjectContent` interface + +2.1.3 to 2.1.5 +---------- +- The `download` interface supports breakpoint +- Rename `getPresignetUrl` to `getPresignedUrl` + +2.1.2 to 2.1.3 +---------- +- Add `download` interface, which is used for concurrent block download +- Add callback of `upload` and `download` progress +- Fix request retry + +2.1.1 to 2.1.2 +---------- +- The interface supports custom parameters +- Fix `ListBucketInventoryConfigurations` + +2.1.0 to 2.1.1 +---------- +- Fix bug of urlencode when calculating signature + +2.0.9 to 2.1.0 +---------- +- `upload` support upload with multithread +- Add `retry` params for interface retry +- Support add customer header +- Signature will restrict part of the header and all parameters +- Fix `listBuckets` with `doamin` + +2.0.8 to 2.0.9 +---------- +- Fix bug of `listObjectVersions` +- Update `getObject` with param of `saveas` + +2.0.7 to 2.0.8 +---------- +- Fix presigned url when using tmpSecretId/tmpSecretKey/Token + +2.0.6 to 2.0.7 +---------- +- Fix response of `ListParts` + +2.0.5 to 2.0.6 +---------- +- Support Domain +- Add Select Object Content Interface +- Add Traffic Limit +- Fix bug of object endswith / + +2.0.4 to 2.0.5 +---------- +- Fix bug when upload object with metadata + +2.0.3 to 2.0.4 +---------- +- Fix bug when using ip-port + +2.0.2 to 2.0.3 +---------- +- Fix path parse bug with /0/ + +2.0.1 to 2.0.2 +---------- +- Fix bug of `putObject` with `fopen` +- Add ut + + +2.0.0 to 2.0.1 +---------- +- Add interface of inventory/tagging/logging +- Fix bug of some interface with query string + + +1.3 to 2.0 +---------- +cos-php-sdk-v5 now uses [GuzzleHttp] for HTTP message. +Due to fact, it depending on PHP >= 5.6. + +- Use the `Qcloud\Cos\Client\getPresignetUrl()` method instead of the `Qcloud\Cos\Command\createPresignedUrl()` + +v2: +```php +$signedUrl = $cosClient->getPresignetUrl($method='putObject', + $args=['Bucket'=>'examplebucket-1250000000', 'Key'=>'exampleobject', 'Body'=>''], + $expires='+30 minutes'); +``` + +v1: +```php +$command = $cosClient->getCommand('putObject', array( + 'Bucket' => "examplebucket-1250000000", + 'Key' => "exampleobject", + 'Body' => '', +)); +$signedUrl = $command->createPresignedUrl('+30 minutes'); +``` + +- `$copSource` parameters of the `Qcloud\Cos\Client\Copy` interface are no longer compatible with older versions. + +v2: + +```php +$result = $cosClient->copy( + $bucket = '', + $Key = '', + $copySorce = array( + 'Region' => '', + 'Bucket' => '', + 'Key' => '', + ) +); +``` + +v1: +```php +$result = $cosClient->Copy( + $bucket = '', + $key = '', + $copysource = '.cos..myqcloud.com/' +); +``` +- Now when uploading files with using `open()` to upload stream, if the local file does not exist, a 0 byte file will be uploaded without throwing an exception, only a warning. + diff --git a/vendor/qcloud/cos-sdk-v5/LICENSE b/vendor/qcloud/cos-sdk-v5/LICENSE new file mode 100644 index 0000000..2c948c8 --- /dev/null +++ b/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. diff --git a/vendor/qcloud/cos-sdk-v5/README.md b/vendor/qcloud/cos-sdk-v5/README.md new file mode 100644 index 0000000..9a951b2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/README.md @@ -0,0 +1,302 @@ +# COS-PHP-SDK-V5 + +腾讯云 COS-PHP-SDK-V5([XML API](https://cloud.tencent.com/document/product/436/7751)) + +[![PHP Version](http://poser.pugx.org/qcloud/cos-sdk-v5/require/php)](https://packagist.org/packages/qcloud/cos-sdk-v5) +[![License](https://poser.pugx.org/qcloud/cos-sdk-v5/license)](LICENSE) +[![Latest Stable Version](https://poser.pugx.org/qcloud/cos-sdk-v5/v/stable)](https://packagist.org/packages/qcloud/cos-sdk-v5) +[![Total Downloads](https://img.shields.io/packagist/dt/qcloud/cos-sdk-v5.svg?style=flat)](https://packagist.org/packages/qcloud/cos-sdk-v5) +[![Build Status](https://api.travis-ci.com/tencentyun/cos-php-sdk-v5.svg?branch=master)](https://app.travis-ci.com/github/tencentyun/cos-php-sdk-v5) +[![codecov](https://codecov.io/gh/tencentyun/cos-php-sdk-v5/branch/master/graph/badge.svg)](https://codecov.io/gh/tencentyun/cos-php-sdk-v5) +[![Support Multiple Versions](https://github.com/tencentyun/cos-php-sdk-v5/actions/workflows/install.yml/badge.svg)](https://github.com/tencentyun/cos-php-sdk-v5/actions/workflows/install.yml) + +## 依赖 + +- [x] PHP >= 5.6 +> 如果您的 php 版本 `>=5.3` 且 `<5.6` , 请使用 [v1.3](https://github.com/tencentyun/cos-php-sdk-v5/tree/1.3) 版本 + +- [x] ext-curl +- [x] ext-json +- [x] ext-simplexml + +## 安装 + +SDK 安装有三种方式: + +- [Composer 方式](#composer-方式) +- [Phar 方式](#Phar-方式) +- [源码方式](#源码方式) + +### Composer 方式 + +推荐使用 Composer 安装 cos-php-sdk-v5,Composer 是 PHP 的依赖管理工具,允许您声明项目所需的依赖,然后自动将它们安装到您的项目中。 + +```bash +composer require qcloud/cos-sdk-v5 +``` + +> 您可以在 [Composer 官网](https://getcomposer.org/) 上找到更多关于如何安装 Composer,配置自动加载以及用于定义依赖项的其他最佳实践等相关信息。 + +#### 安装步骤 + +1. 打开终端; +2. 下载 Composer,执行以下命令: + +```bash +curl -sS https://getcomposer.org/installer | php +``` + +3. 创建一个名为`composer.json`的文件,内容如下: + +```json +{ + "require": { + "qcloud/cos-sdk-v5": "2.*" + } +} +``` + +4. 使用 Composer 安装,执行以下命令: + +```bash +php composer.phar install +``` + +使用该命令后会在当前目录中创建一个 vendor 文件夹,里面包含 SDK 的依赖库和一个 autoload.php 脚本,方便在项目中调用。 + +5. 通过 autoload.php 脚本调用 cos-php-sdk-v5: + +```php +require '/path/to/vendor/autoload.php'; +``` + +现在您的项目已经可以使用 COS 的 V5 版本 SDK 了。 + +### Phar 方式 + +Phar 方式安装 SDK 的步骤如下: + +1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 phar 文件; +> 对于 PHP 版本`>= 5.6`且`<7.2.5`的用户请下载`cos-sdk-v5-6.phar`以使用 Guzzle6 版本。 +> 对于 PHP 版本`>=7.2.5`的用户请下载`cos-sdk-v5-7.phar`以使用 Guzzle7 版本。 +2. 在代码中引入 phar 文件: + +```php +require '/path/to/cos-sdk-v5.phar'; +``` + +### 源码方式 + +源码方式安装 SDK 的步骤如下: + +1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 cos-sdk-v5.tar.gz 文件; +> 对于 PHP 版本`>= 5.6`且`<7.2.5`的用户请下载`cos-sdk-v5-6.tar.gz`以使用 Guzzle6 版本。 +> 对于 PHP 版本`>=7.2.5`的用户请下载`cos-sdk-v5-7.tar.gz`以使用 Guzzle7 版本。 +2. 解压后通过 autoload.php 脚本加载 SDK: + +```php +require '/path/to/cos-sdk-v5/vendor/autoload.php'; +``` + +## 快速入门 + +可参照 Demo 程序,详见 [sample 目录](https://github.com/tencentyun/cos-php-sdk-v5/tree/master/sample) 。 + +## 接口文档 + +PHP SDK 接口文档,详见 [https://cloud.tencent.com/document/product/436/12267](https://cloud.tencent.com/document/product/436/12267) + +### 配置文件 + +```php +$cosClient = new Qcloud\Cos\Client(array( + 'region' => '', + 'credentials' => array( + 'secretId' => '', + 'secretKey' => '' + ) +)); +``` + +若您使用 [临时密钥](https://cloud.tencent.com/document/product/436/14048) 初始化,请用下面方式创建实例。 + +```php +$cosClient = new Qcloud\Cos\Client(array( + 'region' => '', + 'credentials' => array( + 'secretId' => '', + 'secretKey' => '', + 'token' => '' + ) +)); +``` + +### 上传文件 + +- 使用 putObject 接口上传文件(最大 5G) +- 使用 Upload 接口分块上传文件 + +```php +# 上传文件 +## putObject(上传接口,最大支持上传5G文件) +### 上传内存中的字符串 +//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 +try { + $result = $cosClient->putObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'Body' => 'Hello World!')); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 上传文件流 +try { + $result = $cosClient->putObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'Body' => fopen($local_path, 'rb'))); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 设置header和meta +try { + $result = $cosClient->putObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'Body' => fopen($local_path, 'rb'), + 'ACL' => 'string', + 'CacheControl' => 'string', + 'ContentDisposition' => 'string', + 'ContentEncoding' => 'string', + 'ContentLanguage' => 'string', + 'ContentLength' => integer, + 'ContentType' => 'string', + 'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime', + 'Metadata' => array( + 'string' => 'string', + ), + 'StorageClass' => 'string')); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} + +## Upload(高级上传接口,默认使用分块上传最大支持50T) +### 上传内存中的字符串 +try { + $result = $cosClient->Upload( + $bucket = $bucket, + $key = $key, + $body = 'Hello World!'); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 上传文件流 +try { + $result = $cosClient->Upload( + $bucket = $bucket, + $key = $key, + $body = fopen($local_path, 'rb')); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 设置header和meta +try { + $result = $cosClient->Upload( + $bucket= $bucket, + $key = $key, + $body = fopen($local_path, 'rb'), + $options = array( + 'ACL' => 'string', + 'CacheControl' => 'string', + 'ContentDisposition' => 'string', + 'ContentEncoding' => 'string', + 'ContentLanguage' => 'string', + 'ContentLength' => integer, + 'ContentType' => 'string', + 'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime', + 'Metadata' => array( + 'string' => 'string', + ), + 'StorageClass' => 'string')); + print_r($result); +} catch (\Exception $e) { + echo "$e\n"; +} +``` + +### 下载文件 + +- 使用 getObject 接口下载文件 +- 使用 getObjectUrl 接口获取文件下载 URL + +```php +# 下载文件 +## getObject(下载文件) +### 下载到内存 +//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式 +try { + $result = $cosClient->getObject(array( + 'Bucket' => $bucket, + 'Key' => $key)); + echo($result['Body']); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 下载到本地 +try { + $result = $cosClient->getObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'SaveAs' => $local_path)); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 指定下载范围 +/* + * Range 字段格式为 'bytes=a-b' + */ +try { + $result = $cosClient->getObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'Range' => 'bytes=0-10', + 'SaveAs' => $local_path)); +} catch (\Exception $e) { + echo "$e\n"; +} + +### 设置返回header +try { + $result = $cosClient->getObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'ResponseCacheControl' => 'string', + 'ResponseContentDisposition' => 'string', + 'ResponseContentEncoding' => 'string', + 'ResponseContentLanguage' => 'string', + 'ResponseContentType' => 'string', + 'ResponseExpires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime', + 'SaveAs' => $local_path)); +} catch (\Exception $e) { + echo "$e\n"; +} + +## getObjectUrl(获取文件Url) +try { + $signedUrl = $cosClient->getObjectUrl($bucket, $key, '+10 minutes'); + echo $signedUrl; +} catch (\Exception $e) { + echo "$e\n"; +} +``` diff --git a/vendor/qcloud/cos-sdk-v5/composer.json b/vendor/qcloud/cos-sdk-v5/composer.json new file mode 100644 index 0000000..628ba92 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/composer.json @@ -0,0 +1,56 @@ +{ + "name": "qcloud/cos-sdk-v5", + "description": "PHP SDK for QCloud COS", + "keywords": [ + "qcloud", "cos", "php" + ], + "license": "MIT", + "authors": [ + { + "name": "yaozongyou", + "email": "yaozongyou@vip.qq.com" + }, + { + "name": "lewzylu", + "email": "327874225@qq.com" + }, + { + "name": "tuunalai", + "email": "550566181@qq.com" + } + ], + "autoload": { + "psr-4": { + "Qcloud\\Cos\\": "src/" + }, + "files": ["src/Common.php"] + }, + "autoload-dev": { + "psr-4": { + "Qcloud\\Cos\\Tests\\": "tests/" + } + }, + "require": { + "php": ">=5.6", + "ext-curl": "*", + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.2.1 || ^7.0", + "guzzlehttp/guzzle-services": "^1.1", + "guzzlehttp/psr7": "^1.3.1 || ^2.0" + }, + "config": { + "optimize-autoloader": true + }, + "scripts": { + "test": [ + "@putenv XDEBUG_MODE=coverage", + "phpunit -v --color=always" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + } +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php b/vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php new file mode 100644 index 0000000..0d8cf88 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/abortMultipartUpload.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->abortMultipartUpload(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'UploadId' => 'string', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/appendObject.php b/vendor/qcloud/cos-sdk-v5/sample/appendObject.php new file mode 100644 index 0000000..88ac654 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/appendObject.php @@ -0,0 +1,36 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $result = $cosClient->appendObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Position' => 0, //追加对象位置 + 'Body' => fopen($local_path, 'rb'),//读取文件内容 + )); + /* + $result = $cosClient->appendObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Position' => (integer)$result['Position'], //取出上一个追加文件的对象位置进行追加 + 'Body' => "hello", //文件流 + )); + */ + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php new file mode 100644 index 0000000..e8252a3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/blindWatermark.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $blindWatermarkTemplate->setType(2); + $blindWatermarkTemplate->setLevel(3); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $blindWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/catchException.php b/vendor/qcloud/cos-sdk-v5/sample/catchException.php new file mode 100644 index 0000000..0c12f54 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/catchException.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketAcl(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + $statusCode = $e->getStatusCode(); // 获取错误码 + $errorMessage = $e->getMessage(); // 获取错误信息 + $requestId = $e->getRequestId(); // 获取错误的requestId + $errorCode = $e->getCosErrorCode(); // 获取错误名称 + $request = $e->getRequest(); // 获取完整的请求 + $response = $e->getResponse(); // 获取完整的响应 +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php b/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php new file mode 100644 index 0000000..9dbab31 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/ciTransformation.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $imageMogrTemplate->rotate(50); + $imageViewTemplate = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewTemplate->setMode(1); + $imageViewTemplate->setWidth(400); + $imageViewTemplate->setHeight(600); + $imageViewTemplate->setQuality(1, 85); + $ciParamTransformation = new Qcloud\Cos\ImageParamTemplate\CIParamTransformation(); + $ciParamTransformation->addRule($imageMogrTemplate); + $ciParamTransformation->addRule($imageViewTemplate); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $ciParamTransformation->queryString(), + 'SaveAs' => '/data/exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php b/vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php new file mode 100644 index 0000000..5950368 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/completeMultipartUpload.php @@ -0,0 +1,36 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->completeMultipartUpload(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'UploadId' => 'string', + 'Parts' => array( + array( + 'ETag' => 'string', + 'PartNumber' => integer, + ), + array( + 'ETag' => 'string', + 'PartNumber' => integer, + )), + // ... repeated + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/copy.php b/vendor/qcloud/cos-sdk-v5/sample/copy.php new file mode 100644 index 0000000..f400dc3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/copy.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $result = $cosClient->copy( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = 'exampleobject', + $copySource = array( + 'Region' => '', + 'Bucket' => '', + 'Key' => '', + ) + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/copyObject.php b/vendor/qcloud/cos-sdk-v5/sample/copyObject.php new file mode 100644 index 0000000..d58fc93 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/copyObject.php @@ -0,0 +1,27 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->copyObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'CopySource' => urlencode('examplebucket2-125000000.cos.ap-guangzhou.myqcloud.com/exampleobject'), //请注意这里需要urlencode,防止因特殊字符产生的400或404错误 + 'MetadataDirective' => 'Replaced', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/cosClient.php b/vendor/qcloud/cos-sdk-v5/sample/cosClient.php new file mode 100644 index 0000000..4b68d1a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/cosClient.php @@ -0,0 +1,30 @@ + $region, //园区 + 'schema' => 'https', //协议头部,默认为http + 'timeout' => 10, //超时时间 + 'connect_timeout' => 10, //连接超时时间 + 'ip' => '', //ip + 'port' => '', //端口 + 'endpoint' => '', //endpoint + 'domain' => '', //domain可以填写用户自定义域名,或者桶的全球加速域名 + 'proxy' => '', //代理服务器 + 'retry' => 10, //重试次数 + 'userAgent' => '', //UA + 'allow_redirects' => false, //是否follow302 + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey, + 'token' => $token, + 'anonymous' => true, //匿名模式 + ) + ) +); diff --git a/vendor/qcloud/cos-sdk-v5/sample/createBucket.php b/vendor/qcloud/cos-sdk-v5/sample/createBucket.php new file mode 100644 index 0000000..a2ed0d2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createBucket.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createBucket(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php new file mode 100644 index 0000000..ca8e654 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createDocProcessJobs.php @@ -0,0 +1,49 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createDocProcessJobs(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值 + 'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //任务所在的队列 ID + 'Input' => array( + 'Object' => 'Append功能测试.pdf' //待操作的文件对象 + ), + 'Operation' => array( + 'DocProcess' => array( + 'SrcType' => 'pdf', //源数据的后缀类型 + 'TgtType' => 'png', //转换输出目标文件类型 + 'SheetId' => 0, //表格文件参数,转换第 X 个表,默认为1 + 'StartPage' => 1, //从第 X 页开始转换,默认为1 + 'EndPage' => 3, //转换至第 X 页,默认为-1,即转换全部页 + 'ImageParams' => '', //转换后的图片处理参数 + 'DocPassword' => '', //Office 文档的打开密码 + 'Comments' => 0, //是否隐藏批注和应用修订,默认为 0 + 'PaperDirection' => 0, //表格文件转换纸张方向,默认为0 + 'Quality' => 100, //生成预览图的图片质量,取值范围 [1-100],默认值100 + 'Zoom' => 100, //预览图片的缩放参数,取值范围[10-200], 默认值100 + ), + 'Output' => array( + 'Region' => $region, //存储桶的地域 + 'Bucket' => 'examplebucket-1250000000', //存储结果的存储桶 + 'Object' => 'pic-${Page}.jpg', //输出文件路径 + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createFolder.php b/vendor/qcloud/cos-sdk-v5/sample/createFolder.php new file mode 100644 index 0000000..1d3b26d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createFolder.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'folder/', + 'Body' => "", + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php new file mode 100644 index 0000000..090a449 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaConcatJobs.php @@ -0,0 +1,95 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaConcatJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Concat', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 'asdfafiahfiushdfisdhfuis', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'concat-video02.mp4', + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaConcatJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Concat', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'concat-video03.mp4', + ), + 'ConcatTemplate' => array( + 'ConcatFragments' => array( + array( + 'Url' => 'https://example.com/video01.mp4', + 'Mode' => 'Start', +// 'StartTime' => '0', +// 'EndTime' => '7', + ), + array( + 'Url' => 'https://example.com/video02.mp4', + 'Mode' => 'Start', +// 'StartTime' => '0', +// 'EndTime' => '10', + ), + // ... repeated + ), + 'Index' => 1, + 'Container' => array( + 'Format' => 'mp4' + ), + 'Audio' => array( + 'Codec' => 'mp3', + 'Samplerate' => '', + 'Bitrate' => '', + 'Channels' => '', + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Bitrate' => '1000', + 'Width' => '1280', + 'Height' => '', + 'Fps' => '30', + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php new file mode 100644 index 0000000..16e0d90 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaSnapshotJobs.php @@ -0,0 +1,70 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaSnapshotJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Snapshot', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'TemplateId' => 'asdfafiahfiushdfisdhfuis', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'snapshot-${Number}.jpg', + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaSnapshotJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Snapshot', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'snapshot-${Number}.jpg', + ), + 'Snapshot' => array( + 'Mode' => 'Average', + 'Start' => 3, + 'TimeInterval' => '', + 'Count' => 3, + 'Width' => '1280', + 'Height' => '', + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php new file mode 100644 index 0000000..3e97d24 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaTranscodeJobs.php @@ -0,0 +1,164 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 多任务接口 + $result = $cosClient->CreateMediaJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'paaf4fce5521a40888a3034a5de80f6ca', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'example.mp4' + ), + 'Operation' => array( + array( + 'TemplateId' => 't04e1ab86554984f1aa17c062fbf6c007c', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video01.mp4', + ), + 'WatermarkTemplateId' => array( + 't112d18d9b2a9b430e91d3c320f80af341', + ), + ), + array( + 'TemplateId' => 't04e1ab86554984f1aa17c062fbf6c007c', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'wwj-cq-1253960454', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video02.mp4', + ), + 'WatermarkTemplateId' => array( + 't1bf713bb5c6a5496e859aebc4a8973ab5', + ), + ), + ), + )); + + // 单任务接口 + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaTranscodeJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'paaf4fce5521a40888a3034a5de80f6ca', + 'Input' => array( + 'Object' => 'example.mp4' + ), + 'Operation' => array( + 'TemplateId' => 't04e1ab86554984f1aa17c062fbf6c007c', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video02.mp4', + ), + 'Watermark' => arrray( + array( + 'Type' => 'Text', + 'LocMode' => 'Absolute', + 'Dx' => '64', + 'Dy' => '64', + 'Pos' => 'TopRight', + 'Text' => array( + 'Text' => '第一个水印', + 'FontSize' => '30', + 'FontType' => 'simfang.ttf', + 'FontColor' => '#99ff00', + 'Transparency' => '100', // 不透明度 + ), + ), + array( + 'Type' => 'Text', + 'LocMode' => 'Absolute', + 'Dx' => '64', + 'Dy' => '64', + 'Pos' => 'TopLeft', + 'Text' => array( + 'Text' => '第二个水印', + 'FontSize' => '30', + 'FontType' => 'simfang.ttf', + 'FontColor' => '#99ff00', + 'Transparency' => '100', // 不透明度 + ), + ), + ), + ), + )); + $result = $cosClient->DescribeMediaJob(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'j20f7a6be6c5511eca253f3ee9d4082e0', + )); + $result = $cosClient->DescribeMediaJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'paaf4fce5521a40888a3034a5de80f6ca', + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaTranscodeJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'Transcode', + 'QueueId' => 'asdadadfafsdkjhfjghdfjg', + 'CallBack' => 'https://example.com/callback', + 'Input' => array( + 'Object' => 'video01.mp4' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'video01.mkv', + ), + 'Transcode' => array( + 'Container' => array( + 'Format' => 'mp4' + ), + 'Video' => array( + 'Codec' => 'H.264', + 'Profile' => 'high', + 'Bitrate' => '1000', + 'Preset' => 'medium', + 'Width' => '1280', + 'Fps' => '30', + ), + 'Audio' => array( + 'Codec' => 'aac', + 'Samplerate' => '44100', + 'Bitrate' => '128', + 'Channels' => '4', + ), + 'TransConfig' => array( + 'AdjDarMethod' => 'scale', + 'IsCheckReso' => 'false', + 'ResoAdjMethod' => '1', + ), + 'TimeInterval' => array( + 'Start' => '0', + 'Duration' => '60', + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php new file mode 100644 index 0000000..1f16d59 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMediaVoiceSeparateJobs.php @@ -0,0 +1,72 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 使用模版 ----------------- // + $result = $cosClient->createMediaVoiceSeparateJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VoiceSeparate', + 'QueueId' => '', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'test.mp3' + ), + 'Operation' => array( + 'TemplateId' => '', + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VoiceSeparate01.mp3', + 'AuObject' => 'VoiceSeparate02.mp3', + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 使用模版 ----------------- // + + // start --------------- 自定义参数 ----------------- // + $result = $cosClient->createMediaVoiceSeparateJobs(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Tag' => 'VoiceSeparate', + 'QueueId' => '', + 'CallBack' => '', + 'Input' => array( + 'Object' => 'test.mp3' + ), + 'Operation' => array( + 'Output' => array( + 'Region' => $region, + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Object' => 'VoiceSeparate01.mp3', + 'AuObject' => 'VoiceSeparate02.mp3', + ), + 'VoiceSeparate' => array( + 'AudioMode' => 'AudioAndBackground', + 'AudioConfig' => array( + 'Codec' => 'mp3', + 'Samplerate' => '11025', + 'Bitrate' => '256', + 'Channels' => '2', + ), + ), + ), + )); + // 请求成功 + print_r($result); + // end --------------- 自定义参数 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php b/vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php new file mode 100644 index 0000000..d81756f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/createMultipartUpload.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->createMultipartUpload(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + /* + 'CacheControl' => 'string', + 'ContentDisposition' => 'string', + 'ContentEncoding' => 'string', + 'ContentLanguage' => 'string', + 'ContentLength' => integer, + 'ContentType' => 'string', + 'Expires' => 'string', + 'Metadata' => array( + 'string' => 'string', + ), + 'StorageClass' => 'string' + */ + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php new file mode 100644 index 0000000..700cb87 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucket.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucket(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php new file mode 100644 index 0000000..c4ebd87 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketCors.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketCors(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php new file mode 100644 index 0000000..cbb5ba2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php new file mode 100644 index 0000000..5c00244 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DeleteBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php new file mode 100644 index 0000000..bc403a0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketImageStyle.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DeleteBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php new file mode 100644 index 0000000..69985d7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketLifecycle.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketLifecycle(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php new file mode 100644 index 0000000..ce6ac23 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketTagging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php new file mode 100644 index 0000000..2b6a300 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBucketWebsite.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php new file mode 100644 index 0000000..d7f1ba1 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteBuckets.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + //列出所有buckets + $buckets = $cosClient->listBuckets(); + + //若bucket列表不为空则进行删除逻辑,先删除对象,再判断是否有上传的任务进行删除,最后删除桶 + if (!empty($buckets['Buckets'][0])) { + foreach ($buckets['Buckets'][0]['Bucket'] as $key => $value) { + $result = $cosClient->listObjects(array('Bucket' => $value['Name'])); + if (isset($result['Contents'])) { + foreach ($result['Contents'] as $content) { + $cosClient->deleteObject(array('Bucket' => $value['Name'], 'Key' => $content['Key'])); + } + } + while(True){ + $result = $cosClient->ListMultipartUploads( + array('Bucket' => $value['Name'])); + if ($result['Uploads'] == array()) { + break; + } + foreach ($result['Uploads'] as $upload) { + try { + $cosClient->AbortMultipartUpload( + array('Bucket' => $value['Name'], + 'Key' => $upload['Key'], + 'UploadId' => $upload['UploadId'])); + } catch (\Exception $e) { + print_r($e); + } + } + } + $cosClient->deleteBucket(array('Bucket' => $value['Name'])); + } + } + print_r('DELETE ALL BUCKETS SUCCEED!'); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php b/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php new file mode 100644 index 0000000..f771405 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteFolder.php @@ -0,0 +1,48 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +$cos_path = "cos/folder"; +$nextMarker = ''; +$isTruncated = true; +while ( $isTruncated ) { + try { + $result = $cosClient->listObjects( + ['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '', + 'EncodingType' => 'url', + 'Marker' => $nextMarker, + 'Prefix' => $cos_path, + 'MaxKeys' => 1000] + ); + $isTruncated = $result['IsTruncated']; + $nextMarker = $result['NextMarker']; + foreach ( $result['Contents'] as $content ) { + $cos_file_path = $content['Key']; + $local_file_path = $content['Key']; + // 按照需求自定义拼接下载路径 + try { + $cosClient->deleteObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => $cos_file_path, + )); + echo ( $cos_file_path . "\n" ); + } catch ( \Exception $e ) { + echo( $e ); + } + } + } catch ( \Exception $e ) { + echo( $e ); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteObject.php b/vendor/qcloud/cos-sdk-v5/sample/deleteObject.php new file mode 100644 index 0000000..133667c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteObject.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php new file mode 100644 index 0000000..2d1ad16 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/deleteObjectTagging.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->deleteObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php b/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php new file mode 100644 index 0000000..5cba84f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectAudio.php @@ -0,0 +1,54 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 桶文件审核 ----------------- // + $result = $cosClient->detectAudio(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'sound01.mp3', +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 +// ), // 可选 走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 桶文件审核 ----------------- // + + // start --------------- 音频文件地址审核 ----------------- // + $result = $cosClient->detectAudio(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test.mp3', +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 若不传此参数,BizType为空时走默认策略,BizType不为空走定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'CallbackVersion' => '', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 +// ), // 可选 走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 音频文件地址审核 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php b/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php new file mode 100644 index 0000000..5d84675 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectDocument.php @@ -0,0 +1,50 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 存储桶文档审核 + $result = $cosClient->detectDocument(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.docx', +// 'Type' => 'docx', +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + + // 文档URL审核 + $result = $cosClient->detectDocument(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test01.docx', +// 'Type' => 'docx', +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// ), // 选填 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectImage.php b/vendor/qcloud/cos-sdk-v5/sample/detectImage.php new file mode 100644 index 0000000..58a21e9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectImage.php @@ -0,0 +1,47 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + //存储桶图片审核 + $result = $cosClient->detectImage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'test.png', // 桶文件 + 'ci-process' => 'sensitive-content-recognition', +// 'BizType' => '', // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格 +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 + )); + // 请求成功 + print_r($result); + + + //图片链接审核 + $imgUrl = 'https://test.jpg'; + $result = $cosClient->detectImage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '/', // 链接图片资源路径写 / 即可 + 'ci-process' => 'sensitive-content-recognition', + 'DetectUrl' => $imgUrl, +// 'BizType' => '', // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'porn,ads', // 可选 不填走默认策略 或 定制化策略,四种参数:porn,ads等,可使用多种规则,注意规则间不要加空格 +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectImages.php b/vendor/qcloud/cos-sdk-v5/sample/detectImages.php new file mode 100644 index 0000000..b35024a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectImages.php @@ -0,0 +1,42 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->detectImages(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Inputs' => array( + array( + 'Object' => 'test01.png', // 桶文件 +// 'Interval' => '', // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => '', // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'DataId' => 'aaa', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节 + ), + array( + 'Url' => 'http://example.com/test.png', // 图片URL +// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔 +// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节 + ), + ), +// 'Conf' => array( +// 'BizType' => '' // 可选 定制化策略,不传走默认策略 +// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 或 定制化策略,四种参数:Porn,Ads等,可使用多种规则,注意规则间不要加空格 +// ) // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectLable.php b/vendor/qcloud/cos-sdk-v5/sample/detectLable.php new file mode 100644 index 0000000..e0aa056 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectLable.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->DetectLabel(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectText.php b/vendor/qcloud/cos-sdk-v5/sample/detectText.php new file mode 100644 index 0000000..d8f6f12 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectText.php @@ -0,0 +1,71 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // start --------------- 文本内容审核 ----------------- // + $content = '敏感词'; + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Content' => base64_encode($content), // 文本需base64_encode +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'DetectType' => 'Porn,Terrorism,Politics,Ads,Illegal,Abuse', // 选填,在只有BizType时走设定策略的审核场景 +// 'BizType' => '', +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 文本内容审核 ----------------- // + + // start --------------- 存储桶文本文件审核 ----------------- // + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.txt' +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 回调URL 选填 +// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 存储桶文本文件审核 ----------------- // + + // start --------------- 文本文件Url审核 ----------------- // + $result = $cosClient->detectText(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'http://example.com/test.txt' +// 'DataId' => '', // 选填 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +// 'BizType' => '', +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 选填,在只有BizType时走设定策略的审核场景 +// 'Callback' => '', // 选填 回调URL +// 'CallbackVersion' => 'Detail', // 选填 Detail、Simple 默认为 Simple +// ), // 非必选,在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); + // end --------------- 文本文件Url审核 ----------------- // +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php b/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php new file mode 100644 index 0000000..5810fc6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectVideo.php @@ -0,0 +1,64 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + //存储桶视频审核 + $result = $cosClient->detectVideo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test.mp4', // 存储桶文件 +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), + 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。 +// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 + 'Snapshot' => array( +// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。 +// 'TimeInterval' => 50, // 可选 视频截帧频率 + 'Count' => '3', // 视频截帧数量 + ), + ), + )); + + //视频url审核 + $videoUrl = 'http://example.com/test.mp4'; + $result = $cosClient->detectVideo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => $videoUrl, // 视频url +// 'DataId' => '', // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), + 'Conf' => array( +// 'BizType' => '', // 可选 定制化策略 +// 'DetectType' => 'Porn,Terrorism,Politics,Ads', // 可选 不传走默认策略或定制化策略 +// 'Callback' => '', // 可选 回调URL +// 'DetectContent' => 1, // 可选 用于指定是否审核视频声音,当值为0时:表示只审核视频画面截图;值为1时:表示同时审核视频画面截图和视频声音。默认值为0。 +// 'CallbackVersion' => 'Detail', // 可选 回调内容的结构,有效值:Simple(回调内容包含基本信息)、Detail(回调内容包含详细信息)。默认为 Simple。 + 'Snapshot' => array( +// 'Mode' => 'Average', // 可选 截帧模式,默认值为 Interval。Interval 表示间隔模式;Average 表示平均模式;Fps 表示固定帧率模式。 +// 'TimeInterval' => 50, // 可选 视频截帧频率 + 'Count' => '3', // 视频截帧数量 + ), + ), + )); + + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php b/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php new file mode 100644 index 0000000..5cc3747 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectVirus.php @@ -0,0 +1,44 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + // 存储桶文件查毒 + $result = $cosClient->detectVirus(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Object' => 'test01.exe' + ), + 'Conf' => array( + 'DetectType' => 'Virus', +// 'Callback' => '', + ), + )); + + // URL查毒 + $result = $cosClient->detectVirus(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://example.com/test01.exe', + ), + 'Conf' => array( + 'DetectType' => 'Virus', +// 'Callback' => '', + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php b/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php new file mode 100644 index 0000000..cf38dbd --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/detectWebpage.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->detectWebpage(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Input' => array( + 'Url' => 'https://www.xxx.com/', +// 'DataId' => '' // 可选 该字段在审核结果中会返回原始内容,长度限制为512字节。您可以使用该字段对待审核的数据进行唯一业务标识。 + ), +// 'Conf' => array( +//// 'DetectType' => 'Porn,Ads', // 可选 不填走默认策略 +//// 'ReturnHighlightHtml' => 'true', // 可选 'true' 或者 'false' +//// 'Callback' => '', // 可选 +// ), // 可选 在DetectType/BizType都不传的情况下,走默认策略及默认审核场景。 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php b/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php new file mode 100644 index 0000000..9c5641d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/doesBucketExist.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->doesBucketExist( + 'examplebucket-125000000'//存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + ); ; + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php b/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php new file mode 100644 index 0000000..ff297c9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/doesObjectExist.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->doesObjectExist( + 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'exampleobject' //对象名 + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/download.php b/vendor/qcloud/cos-sdk-v5/sample/download.php new file mode 100644 index 0000000..f266e92 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/download.php @@ -0,0 +1,38 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; + +$printbar = function($totalSize, $downloadedSize) { + printf("downloaded [%d/%d]\n", $downloadedSize, $totalSize); +}; + +try { + $result = $cosClient->download( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = 'exampleobject', + $saveAs = $local_path, + $options=['Progress' => $printbar, //指定进度条 + 'PartSize' => 10 * 1024 * 1024, //分块大小 + 'Concurrency' => 5, //并发数 + 'ResumableDownload' => true, //是否开启断点续传,默认为false + 'ResumableTaskFile' => 'tmp.cosresumabletask' //断点文件信息路径,默认为.cosresumabletask + ] + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php b/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php new file mode 100644 index 0000000..db91471 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/downloadFolder.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) + ) +); +$cos_path = 'cos/folder'; +$nextMarker = ''; +$isTruncated = true; + +while ( $isTruncated ) { + try { + $result = $cosClient->listObjects( + ['Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '', + 'EncodingType' => 'url', + 'Marker' => $nextMarker, + 'Prefix' => $cos_path, + 'MaxKeys' => 1000] + ); + } catch ( \Exception $e ) { + echo( $e ); + } + $isTruncated = $result['IsTruncated']; + $nextMarker = $result['NextMarker']; + foreach ( $result['Contents'] as $content ) { + $cos_file_path = $content['Key']; + $local_file_path = $content['Key']; + // 按照需求自定义拼接下载路径 + try { + $result = $cosClient->download( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = $cos_file_path, + $saveAs = $local_file_path + ); + echo ( $cos_file_path . "\n" ); + } catch ( \Exception $e ) { + echo( $e ); + } + } +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php new file mode 100644 index 0000000..d300fe5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBlindWatermark.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setPick(); + $blindWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $blindWatermarkTemplate->setType(2); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php new file mode 100644 index 0000000..bf4e1bc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketAccelerate.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketAccelerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php new file mode 100644 index 0000000..b37d93a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketAcl.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketAcl(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php new file mode 100644 index 0000000..405b63b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketCors.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketCors(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php new file mode 100644 index 0000000..6c74798 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketDomain.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php new file mode 100644 index 0000000..145f331 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->GetBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php new file mode 100644 index 0000000..962c797 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketImageStyle.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->GetBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'StyleName' => 'stylename', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php new file mode 100644 index 0000000..87e78c5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketInventory.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketInvnetory(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Id' => 'string', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php new file mode 100644 index 0000000..0552591 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketLifecycle.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketLifecycle(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php new file mode 100644 index 0000000..9b5b713 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketLogging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketLogging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php new file mode 100644 index 0000000..48d52c5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketReferer.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketReferer(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php new file mode 100644 index 0000000..e89a40a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketTagging(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php new file mode 100644 index 0000000..8a31f5b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php new file mode 100644 index 0000000..fbfaf01 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJob.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeDocProcessJob(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'examplejobid', // JobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php new file mode 100644 index 0000000..c3c53d8 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessJobs.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDescribeDocProcessJobs(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //拉取该队列 ID 下的任务 + 'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值 +// 'NextToken' => '143486', //请求的上下文,用于翻页。上次返回的值 +// 'OrderByTime' => 'Desc', //Desc 或者 Asc。默认为 Desc +// 'Size' => 2, //拉取的最大任务数。默认为10。最大为100 +// 'States' => 'All', //拉取该状态的任务,以,分割,支持多状态:All、Submitted、Running、Success、Failed、Pause、Cancel。默认为 All。 +// 'StartCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间大于该时间的任务 +// 'EndCreationTime' => '2021-10-10T16:20:07+0800', //拉取创建时间小于该时间的任务 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php new file mode 100644 index 0000000..4dcb405 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeDocProcessQueues.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeDocProcessQueues(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php new file mode 100644 index 0000000..3b5fc7e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDescribeMediaVoiceSeparateJob.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->describeMediaVoiceSeparateJob(array( + 'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'examplejobid', // JobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php new file mode 100644 index 0000000..5c418c9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectAudioResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectAudioResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php new file mode 100644 index 0000000..6d72ada --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectDocumentResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectDocumentResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php new file mode 100644 index 0000000..00036ab --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectImageResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectImageResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php new file mode 100644 index 0000000..c98fae6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectTextResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectTextResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php new file mode 100644 index 0000000..a4c4d78 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectVideoResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectVideoResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php new file mode 100644 index 0000000..5c10a97 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectVirusResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectVirusResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php b/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php new file mode 100644 index 0000000..cd79585 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getDetectWebpageResult.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', // 审核时必须为https + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getDetectWebpageResult(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '', // jobId + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php b/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php new file mode 100644 index 0000000..28d328e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getMediaInfo.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->GetMediaInfo( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4 + 'ci-process' => 'videoinfo' //操作类型,固定使用 videoinfo + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObject.php b/vendor/qcloud/cos-sdk-v5/sample/getObject.php new file mode 100644 index 0000000..6e7afda --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObject.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'SaveAs' => '/data/exampleobject', + /* + 'Range' => 'bytes=0-10', + 'ResponseCacheControl' => 'string', + 'ResponseContentDisposition' => 'string', + 'ResponseContentEncoding' => 'string', + 'ResponseContentLanguage' => 'string', + 'ResponseContentType' => 'string', + 'ResponseExpires' => 'string', + */ + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php new file mode 100644 index 0000000..adde2bf --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectSensitiveContentRecognition.php @@ -0,0 +1,52 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + /** + * 此接口已不再维护 2021.11.25 + * 图片审核建议使用 detectImage & detectImages 两个接口 + * 新增功能字段会在 detectImage & detectImages 接口维护 + */ + //存储桶图片审核 + $result = $cosClient->getObjectSensitiveContentRecognition(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'DetectType' => 'porn,politics', //可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格 + 'ci-process' => 'sensitive-content-recognition', +// 'Interval' => 5, // 审核gif时使用 截帧的间隔 +// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'BizType' => '', // 审核策略 + )); + // 请求成功 + print_r($result); + + + //图片链接审核 + $imgUrl = 'https://test.jpg'; + $result = $cosClient->getObjectSensitiveContentRecognition(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => '/', // 链接图片资源路径写 / 即可 + 'DetectType' => 'porn,ads',//可选四种参数:porn,politics,terrorist,ads,可使用多种规则,注意规则间不要加空格 + 'DetectUrl' => $imgUrl, + 'ci-process' => 'sensitive-content-recognition', +// 'Interval' => 5, // 审核gif时使用 截帧的间隔 +// 'MaxFrames' => 5, // 针对 GIF 动图审核的最大截帧数量,需大于0。 +// 'BizType' => '', // 审核策略 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php new file mode 100644 index 0000000..8bb6023 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectTagging.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->getObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php new file mode 100644 index 0000000..823cbfa --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectUrl.php @@ -0,0 +1,40 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey + ) + ) +); +$local_path = "/data/exampleobject"; + +try { + $bucket = "examplebucket-1250000000"; //存储桶,存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = "exampleobject"; //对象在存储桶中的位置,即对象键 + $signedUrl = $cosClient->getObjectUrl( + $bucket, + $key, + '+10 minutes', //签名的有效时间 + [ + 'ResponseContentDisposition' => '111', + 'Params' => [ // Params中可以传自定义querystring + 'aaa' => 'bbb', + 'ccc' => 'ddd' + ], + ] + ); + // 请求成功 + echo $signedUrl; +} catch (\Exception $e) { + // 请求失败 + print_r($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php b/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php new file mode 100644 index 0000000..bc331f5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getObjectWithoutSign.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); + +try { + $bucket = 'examplebucket-125000000'; //存储桶,存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = "exampleobject"; //对象在存储桶中的位置,即对象键 + $signedUrl = $cosClient -> getObjectUrlWithoutSign($bucket, $key); + + // 请求成功 + echo $signedUrl; +} catch (\Exception $e) { + // 请求失败 + print_r($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php b/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php new file mode 100644 index 0000000..147cf68 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getPresignedUrl.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $signedUrl = $cosClient->getPresignedUrl( + $method='getObject', + $args=array( + 'Bucket'=>'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key'=>'exampleobject', + 'Body'=>'', + 'Params'=>array(), + 'Headers'=>array()), //若上传加入headers,content-md5写法为"content-md5" => base64_encode( md5( Body, true ) ) + $expires='+30 minutes'); + // 请求成功 + echo($signedUrl); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php b/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php new file mode 100644 index 0000000..68d928f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php @@ -0,0 +1,41 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$time = 3.14; +$local_path = "/data/exampleobject/test.jpg"; +try { + /* + * 如果访问400,media bucket unbinded, bucket's host is unavailable + * 请先在控制台开启媒体处理开关 + */ + $result = $cosClient->getSnapshot( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' =>'exampleobject', //桶中的媒体文件,如test.mp4 + 'ci-process' => 'snapshot', //操作类型,固定使用 snapshot + 'Time' => $time, //截图的时间点,单位为秒 + 'SaveAs' => $local_path, //本地保存路径 +// 'Width' => 0, +// 'Height' => 0, +// 'Format' => 'jpg', +// 'Rotate' => 'auto', +// 'Mode' => 'exactframe', + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/headBucket.php b/vendor/qcloud/cos-sdk-v5/sample/headBucket.php new file mode 100644 index 0000000..ff1fd48 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/headBucket.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->headBucket(array( + 'Bucket' => 'examplebucket-125000000' //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/headObject.php b/vendor/qcloud/cos-sdk-v5/sample/headObject.php new file mode 100644 index 0000000..e5e8e8b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/headObject.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->headObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageAve.php b/vendor/qcloud/cos-sdk-v5/sample/imageAve.php new file mode 100644 index 0000000..892bbcb --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageAve.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageAve(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageExif.php b/vendor/qcloud/cos-sdk-v5/sample/imageExif.php new file mode 100644 index 0000000..a9973ce --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageExif.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageExif(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php b/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php new file mode 100644 index 0000000..3166578 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageInfo.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->ImageInfo(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php b/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php new file mode 100644 index 0000000..435c12e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageMogr.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $imageMogrTemplate->rotate(50); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageMogrTemplate->queryString(), + 'SaveAs' => '/data/exampleobject', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php b/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php new file mode 100644 index 0000000..0b70b7e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageProcess.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageMogrTemplate, "resultobject"); + $result = $cosClient->ImageProcess(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageView.php b/vendor/qcloud/cos-sdk-v5/sample/imageView.php new file mode 100644 index 0000000..7a9873c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageView.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageViewTemplate = new Qcloud\Cos\ImageParamTemplate\ImageViewTemplate(); + $imageViewTemplate->setMode(1); + $imageViewTemplate->setWidth(400); + $imageViewTemplate->setHeight(600); + $imageViewTemplate->setQuality(1, 85); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageViewTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php new file mode 100644 index 0000000..14a0b23 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/imageWatermark.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $imageWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\ImageWatermarkTemplate(); + $imageWatermarkTemplate->setImage("http://examplebucket-125000000.cos.ap-beijing.myqcloud.com/shuiyin.jpeg"); + $imageWatermarkTemplate->setGravity('center'); + $imageWatermarkTemplate->setDx(10); + $imageWatermarkTemplate->setDy(10); + $imageWatermarkTemplate->setSpcent(100); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $imageWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php b/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php new file mode 100644 index 0000000..3ed6de2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/listBuckets.php @@ -0,0 +1,23 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->listBuckets(); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php b/vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php new file mode 100644 index 0000000..dc1050e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/listMultipartUploads.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->listMultipartUploads(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '/', + 'EncodingType' => 'url', + 'KeyMarker' => 'string', + 'UploadIdMarker' => 'string', + 'Prefix' => 'prfix', + 'MaxUploads' => 1000, + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/listObjects.php b/vendor/qcloud/cos-sdk-v5/sample/listObjects.php new file mode 100644 index 0000000..562a98b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/listObjects.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->listObjects(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Delimiter' => '/', //Delimiter表示分隔符, 设置为/表示列出当前目录下的object, 设置为空表示列出所有的object + 'EncodingType' => 'url',//编码格式,对应请求中的 encoding-type 参数 + 'Marker' => 'prefix/picture.jpg',//起始对象键标记 + 'Prefix' => 'prfix/', //Prefix表示列出的object的key以prefix开始 + 'MaxKeys' => 1000, // 设置最大遍历出多少个对象, 一次listObjects最大支持1000 + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/listParts.php b/vendor/qcloud/cos-sdk-v5/sample/listParts.php new file mode 100644 index 0000000..d0c1053 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/listParts.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->listParts(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'UploadId' => 'NWNhNDY0YzFfMmZiNTM1MGFfNTM2YV8xYjliMTg', + 'PartNumberMarker' => 1, + 'MaxParts' => 1000, + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/picOperations.php b/vendor/qcloud/cos-sdk-v5/sample/picOperations.php new file mode 100644 index 0000000..5d419b6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/picOperations.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $imageMogrTemplate = new Qcloud\Cos\ImageParamTemplate\ImageMogrTemplate(); + $imageMogrTemplate->thumbnailByScale(50); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(0); + $picOperationsTemplate->addRule($imageMogrTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php new file mode 100644 index 0000000..872f9a9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBlindWatermark.php @@ -0,0 +1,34 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $blindWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\BlindWatermarkTemplate(); + $blindWatermarkTemplate->setText("Test"); + $blindWatermarkTemplate->setType(3); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($blindWatermarkTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php new file mode 100644 index 0000000..791631a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketAccelerate.php @@ -0,0 +1,25 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketAccelerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Status' => 'Enabled' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php new file mode 100644 index 0000000..716ac8b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketAcl.php @@ -0,0 +1,39 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketAcl(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + '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"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php new file mode 100644 index 0000000..5ae60b5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketCors.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketCors(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/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\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php new file mode 100644 index 0000000..0431c4c --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketDomain.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketDomain(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'DomainRules' => array( + array( + 'Name' => 'www.qq.com', + 'Status' => 'ENABLED', + 'Type' => 'REST', + 'ForcedReplacement' => 'CNAME', + ), + // ... repeated + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php new file mode 100644 index 0000000..e7bcda4 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketGuetzli.php @@ -0,0 +1,24 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->PutBucketGuetzli(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php new file mode 100644 index 0000000..4df401b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketImageStyle.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->PutBucketImageStyle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'StyleName' => 'stylename', + 'StyleBody' => 'imageMogr2/thumbnail/!50px', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php new file mode 100644 index 0000000..8e6f48d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketInventory.php @@ -0,0 +1,45 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketInventory(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Id' => 'string', + 'Destination' => array( + 'COSBucketDestination'=>array( + 'Format' => 'CSV', + 'AccountId' => '125000000', + 'Bucket' => 'qcs::cos:ap-chengdu::examplebucket-125000000', + 'Prefix' => 'string', + ) + ), + 'IsEnabled' => 'True', + 'Schedule' => array( + 'Frequency' => 'Daily', + ), + 'Filter' => array( + 'Prefix' => 'string', + ), + 'IncludedObjectVersions' => 'Current', + 'OptionalFields' => array( + 'Size', + 'ETag', + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php new file mode 100644 index 0000000..8f3b963 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketLifecycle.php @@ -0,0 +1,44 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketLifecycle(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Rules' => array( + array( + 'Expiration' => array( + 'Days' => integer, + ), + 'ID' => 'string', + 'Filter' => array( + 'Prefix' => 'string' + ), + 'Status' => 'string', + 'Transitions' => array( + array( + 'Days' => integer, + 'StorageClass' => 'string' + ), + // ... repeated + ), + ), + // ... repeated + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php new file mode 100644 index 0000000..0695959 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketLogging.php @@ -0,0 +1,28 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketLogging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'LoggingEnabled' => array( + 'TargetBucket' => 'examplebucket2-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'TargetPrefix' => '', + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php new file mode 100644 index 0000000..1de0687 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketReferer.php @@ -0,0 +1,35 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials' => array( + 'secretId' => $secretId, + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketReferer( + array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Status' => 'Enabled', //是否开启防盗链,枚举值:Enabled、Disabled + 'RefererType' => 'White-List', //防盗链类型,枚举值:Black-List、White-List + 'DomainList' => array( + 'Domains' => array( + '*.qq.com', + '*.qcloud.com', + ) + ), //生效域名列表 +// 'EmptyReferConfiguration' => 'Allow',//是否允许空 Referer 访问,枚举值:Allow、Deny,默认值为 Deny + ) + ); + // 请求成功 + echo($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php new file mode 100644 index 0000000..bf27b1e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketTagging.php @@ -0,0 +1,32 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putBucketTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'TagSet' => array( + array('Key'=>'key1', + 'Value'=>'value1', + ), + array('Key'=>'key2', + 'Value'=>'value2', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php b/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php new file mode 100644 index 0000000..96afb28 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putBucketWebsite.php @@ -0,0 +1,46 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +try { + $result = $cosClient->putBucketWebsite(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'IndexDocument' => array( + 'Suffix' => 'index.html', + ), + 'RedirectAllRequestsTo' => array( + 'Protocol' => 'https', + ), + 'ErrorDocument' => array( + 'Key' => 'Error.html', + ), + 'RoutingRules' => array( + array( + 'Condition' => array( + 'HttpErrorCodeReturnedEquals' => '405', + ), + 'Redirect' => array( + 'Protocol' => 'https', + 'ReplaceKeyWith' => '404.html', + ), + ), + // ... repeated + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php b/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php new file mode 100644 index 0000000..dfa021f --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putImageStyle.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $imageStyleTemplate = new Qcloud\Cos\ImageParamTemplate\ImageStyleTemplate(); + $imageStyleTemplate->setStyle("stylename"); + $picOperationsTemplate = new \Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageStyleTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putObject.php b/vendor/qcloud/cos-sdk-v5/sample/putObject.php new file mode 100644 index 0000000..56860c9 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putObject.php @@ -0,0 +1,48 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +//添加tagging +/*$tagSet = http_build_query( array( + urlencode("key1") => urlencode("value1"), + urlencode("key2") => urlencode("value2")), + '', + '&' +); */ +try { + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + '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', + 'Tagging' => $tagSet //最多10个标签 + */ + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php b/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php new file mode 100644 index 0000000..4fe22ed --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putObjectTagging.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->putObjectTagging(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'TagSet' => array( + array('Key'=>'key1', + 'Value'=>'value1', + ), + array('Key'=>'key2', + 'Value'=>'value2', + ), + ), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo "$e\n"; +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php b/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php new file mode 100644 index 0000000..1951ada --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/putQrcode.php @@ -0,0 +1,33 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; +try { + $imageQrcodeTemplate = new Qcloud\Cos\ImageParamTemplate\ImageQrcodeTemplate(); + $imageQrcodeTemplate->setMode(0); + $picOperationsTemplate = new Qcloud\Cos\ImageParamTemplate\PicOperationsTransformation(); + $picOperationsTemplate->setIsPicInfo(1); + $picOperationsTemplate->addRule($imageQrcodeTemplate, "resultobject"); + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'PicOperations' => $picOperationsTemplate->queryString(), + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/qrcode.php b/vendor/qcloud/cos-sdk-v5/sample/qrcode.php new file mode 100644 index 0000000..0f35466 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/qrcode.php @@ -0,0 +1,26 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->Qrcode(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Cover' => 0, + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php b/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php new file mode 100644 index 0000000..16fd8d5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/qrcodeGenerate.php @@ -0,0 +1,27 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->QrcodeGenerate(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'QrcodeContent' => '', + 'QrcodeMode' => 0, + 'QrcodeWidth' => '200', + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/restoreObject.php b/vendor/qcloud/cos-sdk-v5/sample/restoreObject.php new file mode 100644 index 0000000..cfe0880 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/restoreObject.php @@ -0,0 +1,29 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->restoreObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Days' => integer, + 'CASJobParameters' => array( + 'Tier' =>'string' + ) + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php b/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php new file mode 100644 index 0000000..c9b8de2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/selectObjectContent.php @@ -0,0 +1,85 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) +)); +try { + $result = $cosClient->selectObjectContent(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Expression' => 'Select * from COSObject s', + 'ExpressionType' => 'SQL', + 'InputSerialization' => array( + 'CompressionType' => 'None', + 'CSV' => array( + 'FileHeaderInfo' => 'NONE', + 'RecordDelimiter' => '\n', + 'FieldDelimiter' => ',', + 'QuoteEscapeCharacter' => '"', + 'Comments' => '#', + 'AllowQuotedRecordDelimiter' => 'FALSE' + ) + ), + 'OutputSerialization' => array( + 'CSV' => array( + 'QuoteField' => 'ASNEEDED', + 'RecordDelimiter' => '\n', + 'FieldDelimiter' => ',', + 'QuoteCharacter' => '"', + 'QuoteEscapeCharacter' => '"' + ) + ), + 'RequestProgress' => array( + 'Enabled' => 'FALSE' + ) + )); + // 请求成功 + foreach ($result['Data'] as $data) { + // 迭代遍历select结果 + print_r($data); + } +} catch (\Exception $e) { + // 请求失败 + echo($e); +} + +try { + $result = $cosClient->selectObjectContent(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Expression' => 'Select * from COSObject s', + 'ExpressionType' => 'SQL', + 'InputSerialization' => array( + 'CompressionType' => 'None', + 'JSON' => array( + 'Type' => 'DOCUMENT' + ) + ), + 'OutputSerialization' => array( + 'JSON' => array( + 'RecordDelimiter' => '\n', + ) + ), + 'RequestProgress' => array( + 'Enabled' => 'FALSE' + ) + )); + // 请求成功 + foreach ($result['Data'] as $data) { + // 迭代遍历select结果 + print_r($data); + } +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php b/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php new file mode 100644 index 0000000..f8ef0a8 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/textWatermark.php @@ -0,0 +1,31 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $textWatermarkTemplate = new Qcloud\Cos\ImageParamTemplate\TextWatermarkTemplate(); + $textWatermarkTemplate->setText("testetst"); + $textWatermarkTemplate->setGravity('center'); + $textWatermarkTemplate->setFontsize(30); + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'ImageHandleParam' => $textWatermarkTemplate->queryString(), + 'SaveAs' => '/data/exampleobject' + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php b/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php new file mode 100644 index 0000000..9bc8b1d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/trafficLimit.php @@ -0,0 +1,40 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); + +$local_path = '/data/exampleobject'; +try { + //上传对象,单链接限速 + $result = $cosClient->putObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => fopen($local_path, 'rb'), + 'TrafficLimit' => 8 * 1024 * 1024 // 限制为1MB/s + )); + // 请求成功 + print_r($result); + + //下载对象,单链接限速 + $result = $cosClient->getObject(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'SaveAs' => $local_path, + 'TrafficLimit' => 8 * 1024 * 1024 // 限制为1MB/s + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/upload.php b/vendor/qcloud/cos-sdk-v5/sample/upload.php new file mode 100644 index 0000000..1c92698 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/upload.php @@ -0,0 +1,56 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +$local_path = "/data/exampleobject"; + +$printbar = function($totalSize, $uploadedSize) { + printf("uploaded [%d/%d]\n", $uploadedSize, $totalSize); +}; + +try { + $result = $cosClient->upload( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $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', //存储类型 + 'Progress' => $printbar, //指定进度条 + 'PartSize' => 10 * 1024 * 1024, //分块大小 + 'Concurrency' => 5 //并发数 + ) + */ + ); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php b/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php new file mode 100644 index 0000000..3885f7d --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/uploadFolder.php @@ -0,0 +1,42 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey + ) + ) +); + +function uploadfiles( $path, $cosClient ) { + foreach ( scandir( $path ) as $afile ) { + if ( $afile == '.' || $afile == '..' ) continue; + if ( is_dir( $path.'/'.$afile ) ) { + uploadfiles( $path.'/'.$afile, $cosClient ); + } else { + $local_file_path = $path.'/'.$afile; + $cos_file_path = $local_file_path; + // 按照需求自定义拼接上传路径 + try { + $cosClient->upload( + $bucket = 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + $key = $cos_file_path, + $body = fopen( $cos_file_path, 'rb' ) + ); + } catch ( \Exception $e ) { + echo( $e ); + } + } + } +} + +$local_path = '/data/home/folder'; +uploadfiles( $local_path, $cosClient ); diff --git a/vendor/qcloud/cos-sdk-v5/sample/uploadPart.php b/vendor/qcloud/cos-sdk-v5/sample/uploadPart.php new file mode 100644 index 0000000..b1709cc --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/sample/uploadPart.php @@ -0,0 +1,30 @@ + $region, + 'schema' => 'https', //协议头部,默认为http + 'credentials'=> array( + 'secretId' => $secretId , + 'secretKey' => $secretKey))); +try { + $result = $cosClient->uploadPart(array( + 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket + 'Key' => 'exampleobject', + 'Body' => 'string', + 'UploadId' => 'NWNhNDY0YzFfMmZiNTM1MGFfNTM2YV8xYjliMTg', + 'PartNumber' => 1, + 'ContentMD5' => 'string', + 'ContentLength' => 100, + )); + // 请求成功 + print_r($result); +} catch (\Exception $e) { + // 请求失败 + echo($e); +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Client.php b/vendor/qcloud/cos-sdk-v5/src/Client.php new file mode 100644 index 0000000..3d7a7f2 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Client.php @@ -0,0 +1,490 @@ +rawCosConfig = $cosConfig; + $this->cosConfig['schema'] = isset($cosConfig['schema']) ? $cosConfig['schema'] : 'http'; + $this->cosConfig['region'] = isset($cosConfig['region']) ? region_map($cosConfig['region']) : null; + $this->cosConfig['appId'] = isset($cosConfig['credentials']['appId']) ? $cosConfig['credentials']['appId'] : null; + $this->cosConfig['secretId'] = isset($cosConfig['credentials']['secretId']) ? trim($cosConfig['credentials']['secretId']) : ''; + $this->cosConfig['secretKey'] = isset($cosConfig['credentials']['secretKey']) ? trim($cosConfig['credentials']['secretKey']) : ''; + $this->cosConfig['anonymous'] = isset($cosConfig['credentials']['anonymous']) ? $cosConfig['credentials']['anonymous'] : false; + $this->cosConfig['token'] = isset($cosConfig['credentials']['token']) ? trim($cosConfig['credentials']['token']) : null; + $this->cosConfig['timeout'] = isset($cosConfig['timeout']) ? $cosConfig['timeout'] : 3600; + $this->cosConfig['connect_timeout'] = isset($cosConfig['connect_timeout']) ? $cosConfig['connect_timeout'] : 3600; + $this->cosConfig['ip'] = isset($cosConfig['ip']) ? $cosConfig['ip'] : null; + $this->cosConfig['port'] = isset($cosConfig['port']) ? $cosConfig['port'] : null; + $this->cosConfig['endpoint'] = isset($cosConfig['endpoint']) ? $cosConfig['endpoint'] : null; + $this->cosConfig['domain'] = isset($cosConfig['domain']) ? $cosConfig['domain'] : null; + $this->cosConfig['proxy'] = isset($cosConfig['proxy']) ? $cosConfig['proxy'] : null; + $this->cosConfig['retry'] = isset($cosConfig['retry']) ? $cosConfig['retry'] : 1; + $this->cosConfig['userAgent'] = isset($cosConfig['userAgent']) ? $cosConfig['userAgent'] : 'cos-php-sdk-v5.'. Client::VERSION; + $this->cosConfig['pathStyle'] = isset($cosConfig['pathStyle']) ? $cosConfig['pathStyle'] : false; + $this->cosConfig['signHost'] = isset($cosConfig['signHost']) ? $cosConfig['signHost'] : true; + $this->cosConfig['allow_redirects'] = isset($cosConfig['allow_redirects']) ? $cosConfig['allow_redirects'] : false; + $this->cosConfig['allow_accelerate'] = isset($cosConfig['allow_accelerate']) ? $cosConfig['allow_accelerate'] : false; + + // check config + $this->inputCheck(); + + $service = Service::getService(); + $handler = HandlerStack::create(); + $handler->push(Middleware::retry($this->retryDecide(), $this->retryDelay())); + $handler->push(Middleware::mapRequest(function (RequestInterface $request) { + return $request->withHeader('User-Agent', $this->cosConfig['userAgent']); + })); + if ($this->cosConfig['anonymous'] != true) { + $handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig['signHost'])); + } + if ($this->cosConfig['token'] != null) { + $handler->push(Middleware::mapRequest(function (RequestInterface $request) { + return $request->withHeader('x-cos-security-token', $this->cosConfig['token']); + })); + } + $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']; + $this->httpClient = new HttpClient([ + 'base_uri' => "{$this->cosConfig['schema']}://cos.{$area}.myqcloud.com/", + 'timeout' => $this->cosConfig['timeout'], + 'handler' => $handler, + 'proxy' => $this->cosConfig['proxy'], + 'allow_redirects' => $this->cosConfig['allow_redirects'] + ]); + $this->desc = new Description($service); + $this->api = (array) $this->desc->getOperations(); + parent::__construct($this->httpClient, $this->desc, [$this, + 'commandToRequestTransformer'], [$this, 'responseToResultTransformer'], + null); + } + + public function inputCheck() { + $message = null; + //检查Region + if (empty($this->cosConfig['region']) && + empty($this->cosConfig['domain']) && + empty($this->cosConfig['endpoint']) && + empty($this->cosConfig['ip'])) { + $message = 'Region is empty'; + } + //检查Secret + if (empty($this->cosConfig['secretId']) || empty($this->cosConfig['secretKey'])) { + $message = 'Secret is empty'; + } + if ($message !== null) { + $e = new Exception\CosException($message); + $e->setExceptionCode('Invalid Argument'); + throw $e; + } + } + + + public function retryDecide() { + return function ( + $retries, + RequestInterface $request, + ResponseInterface $response = null, + \Exception $exception = null + ) { + if ($retries >= $this->cosConfig['retry']) { + return false; + } + if ($response != null && $response->getStatusCode() >= 400 ) { + return true; + } + if ($exception instanceof Exception\ServiceResponseException) { + if ($exception->getStatusCode() >= 400) { + return true; + } + } + + if ($exception instanceof ConnectException) { + return true; + } + + return false; + }; + } + + public function retryDelay() { + return function ($numberOfRetries) { + return 1000 * $numberOfRetries; + }; + } + + public function commandToRequestTransformer(CommandInterface $command) + { + $this->action = $command->GetName(); + $this->operation = $this->api[$this->action]; + $transformer = new CommandToRequestTransformer($this->cosConfig, $this->operation); + $seri = new Serializer($this->desc); + $request = $seri($command); + $request = $transformer->bucketStyleTransformer($command, $request); + $request = $transformer->uploadBodyTransformer($command, $request); + $request = $transformer->metadataTransformer($command, $request); + $request = $transformer->queryStringTransformer($command, $request); + $request = $transformer->headerTransformer($command, $request); + $request = $transformer->md5Transformer($command, $request); + $request = $transformer->specialParamTransformer($command, $request); + $request = $transformer->ciParamTransformer($command, $request); + $request = $transformer->cosDomain2CiTransformer($command, $request); + return $request; + } + + public function responseToResultTransformer(ResponseInterface $response, RequestInterface $request, CommandInterface $command) + { + $transformer = new ResultTransformer($this->cosConfig, $this->operation); + $transformer->writeDataToLocal($command, $request, $response); + $deseri = new Deserializer($this->desc, true); + $result = $deseri($response, $request, $command); + + $result = $transformer->metaDataTransformer($command, $response, $result); + $result = $transformer->extraHeadersTransformer($command, $request, $result); + $result = $transformer->selectContentTransformer($command, $result); + $result = $transformer->ciContentInfoTransformer($command, $result); + return $result; + } + + public function __destruct() { + } + + public function __call($method, array $args) { + try { + $rt = parent::__call(ucfirst($method), $args); + return $rt; + } catch (\Exception $e) { + $previous = $e->getPrevious(); + if ($previous !== null) { + throw $previous; + } else { + throw $e; + } + } + } + + public function getApi() { + return $this->api; + } + + private function getCosConfig() { + return $this->cosConfig; + } + + private function createPresignedUrl(RequestInterface $request, $expires) { + return $this->signature->createPresignedUrl($request, $expires); + } + + public function getPresignedUrl($method, $args, $expires = "+30 minutes") { + $command = $this->getCommand($method, $args); + $request = $this->commandToRequestTransformer($command); + return $this->createPresignedUrl($request, $expires); + } + + + public function getObjectUrl($bucket, $key, $expires = "+30 minutes", array $args = array()) { + $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key)); + $request = $this->commandToRequestTransformer($command); + return $this->createPresignedUrl($request, $expires)->__toString(); + } + + public function getObjectUrlWithoutSign($bucket, $key, array $args = array()) { + $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key)); + $request = $this->commandToRequestTransformer($command); + return $request->getUri()-> __toString(); + } + + public function upload($bucket, $key, $body, $options = array()) { + $body = Psr7\Utils::streamFor($body); + $options['Retry'] = $this->cosConfig['retry']; + $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE; + if ($body->getSize() < $options['PartSize']) { + $rt = $this->putObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'Body' => $body, + ) + $options); + } + else { + $multipartUpload = new MultipartUpload($this, $body, array( + 'Bucket' => $bucket, + 'Key' => $key, + ) + $options); + + $rt = $multipartUpload->performUploading(); + } + return $rt; + } + + public function download($bucket, $key, $saveAs, $options = array()) { + $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : RangeDownload::DEFAULT_PART_SIZE; + $contentLength = 0; + $versionId = isset($options['VersionId']) ? $options['VersionId'] : ''; + + $rt = $this->headObject(array( + 'Bucket'=>$bucket, + 'Key'=>$key, + 'VersionId'=>$versionId, + ) + ); + $contentLength = $rt['ContentLength']; + $resumableJson = [ + 'LastModified' => $rt['LastModified'], + 'ContentLength' => $rt['ContentLength'], + 'ETag' => $rt['ETag'], + 'Crc64ecma' => $rt['Crc64ecma'] + ]; + $options['ResumableJson'] = $resumableJson; + + if ($contentLength < $options['PartSize']) { + $rt = $this->getObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'SaveAs' => $saveAs, + ) + $options); + } else { + $rangeDownload = new RangeDownload($this, $contentLength, $saveAs, array( + 'Bucket' => $bucket, + 'Key' => $key, + ) + $options); + + $rt = $rangeDownload->performDownloading(); + } + return $rt; + } + + public function resumeUpload($bucket, $key, $body, $uploadId, $options = array()) { + $body = Psr7\Utils::streamFor($body); + $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE; + $multipartUpload = new MultipartUpload($this, $body, array( + 'Bucket' => $bucket, + 'Key' => $key, + 'UploadId' => $uploadId, + ) + $options); + + $rt = $multipartUpload->resumeUploading(); + return $rt; + } + + public function copy($bucket, $key, $copySource, $options = array()) { + + $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : Copy::DEFAULT_PART_SIZE; + + // set copysource client + $sourceConfig = $this->rawCosConfig; + $sourceConfig['region'] = $copySource['Region']; + $cosSourceClient = new Client($sourceConfig); + $copySource['VersionId'] = isset($copySource['VersionId']) ? $copySource['VersionId'] : ''; + + $rt = $cosSourceClient->headObject( + array('Bucket'=>$copySource['Bucket'], + 'Key'=>$copySource['Key'], + 'VersionId'=>$copySource['VersionId'], + ) + ); + + $contentLength = $rt['ContentLength']; + // sample copy + if ($contentLength < $options['PartSize']) { + $rt = $this->copyObject(array( + 'Bucket' => $bucket, + 'Key' => $key, + 'CopySource' => "{$copySource['Bucket']}.cos.{$copySource['Region']}.myqcloud.com/". urlencode("{$copySource['Key']}")."?versionId={$copySource['VersionId']}", + ) + $options + ); + return $rt; + } + // multi part copy + $copySource['ContentLength'] = $contentLength; + $copy = new Copy($this, $copySource, array( + 'Bucket' => $bucket, + 'Key' => $key + ) + $options + ); + return $copy->copy(); + } + + public function doesBucketExist($bucket, array $options = array()) + { + try { + $this->HeadBucket(array( + 'Bucket' => $bucket)); + return true; + } catch (\Exception $e){ + return false; + } + } + + 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 explodeKey($key) { + // Remove a leading slash if one is found + $split_key = explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key); + // Remove empty element + $split_key = array_filter($split_key, function($var) { + return !($var == '' || $var == null); + }); + $final_key = implode("/", $split_key); + if (substr($key, -1) == '/') { + $final_key = $final_key . '/'; + } + return $final_key; + } + + + public static function handleSignature($secretId, $secretKey, $signHost) { + return function (callable $handler) use ($secretId, $secretKey, $signHost) { + return new SignatureMiddleware($handler, $secretId, $secretKey, $signHost); + }; + } + + public static function handleErrors() { + return function (callable $handler) { + return new ExceptionMiddleware($handler); + }; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php b/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php new file mode 100644 index 0000000..ce5b970 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/CommandToRequestTransformer.php @@ -0,0 +1,296 @@ +config = $config; + $this->operation = $operation; + } + + // format bucket style + + public function bucketStyleTransformer( CommandInterface $command, RequestInterface $request ) { + $action = $command->getName(); + if ($action == 'ListBuckets') { + $uri = "service.cos.myqcloud.com"; + + if ($this->config['endpoint'] != null) { + $uri = $this->config['endpoint']; + } + if ($this->config['domain'] != null) { + $uri = $this->config['domain']; + } + if ($this->config['ip'] != null) { + $uri = $this->config['ip']; + if ($this->config['port'] != null) { + $uri = $this->config['ip'] . ":" . $this->config['port']; + } + } + return $request->withUri(new Uri($this->config['schema']."://". $uri. "/")); + } + $operation = $this->operation; + $bucketname = $command['Bucket']; + + $appId = $this->config['appId']; + if ( $appId != null && endWith( $bucketname, '-'.$appId ) == False ) { + $bucketname = $bucketname.'-'.$appId; + } + $command['Bucket'] = $bucketname; + $path = ''; + + $http_method = $operation['httpMethod']; + $uri = $operation['uri']; + + // Hoststyle is used by default + // Pathstyle + if ( $this->config['pathStyle'] != true ) { + if ( isset( $operation['parameters']['Bucket'] ) && $command->hasParam( 'Bucket' ) ) { + $uri = str_replace( '{Bucket}', '', $uri ); + } + + if ( isset( $operation['parameters']['Key'] ) && $command->hasParam( 'Key' ) ) { + $uri = str_replace( '{/Key*}', encodeKey( $command['Key'] ), $uri ); + } + } + + if ($this->config['endpoint'] == null) { + $this->config['endpoint'] = "myqcloud.com"; + } + + $domain_type = '.cos.'; + if ($action == 'PutBucketImageStyle' || $action == 'GetBucketImageStyle' || $action == 'DeleteBucketImageStyle' + || $action == 'PutBucketGuetzli' || $action == 'GetBucketGuetzli' || $action == 'DeleteBucketGuetzli') { + $domain_type = '.pic.'; + } + + $origin_host = $this->config['allow_accelerate'] ? + $bucketname . $domain_type . 'accelerate' . '.' . $this->config['endpoint'] : + $bucketname . $domain_type . $this->config['region'] . '.' . $this->config['endpoint']; + + // domain + if ( $this->config['domain'] != null ) { + $origin_host = $this->config['domain']; + } + $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 . $uri; + $uri = new Uri( $path ); + $query = $request->getUri()->getQuery(); + if ( $uri->getQuery() != $query && $uri->getQuery() != '' ) { + $query = $uri->getQuery() . '&' . $request->getUri()->getQuery(); + } + $uri = $uri->withQuery( $query ); + $request = $request->withUri( $uri ); + $request = $request->withHeader( 'Host', $origin_host ); + return $request; + } + + // format upload body + + public function uploadBodyTransformer( CommandInterface $command, $request, $bodyParameter = 'Body', $sourceParameter = 'SourceFile' ) { + + $operation = $this->operation; + if ( !isset( $operation['parameters']['Body'] ) ) { + return $request; + } + $source = isset( $command[$sourceParameter] ) ? $command[$sourceParameter] : null; + $body = isset( $command[$bodyParameter] ) ? $command[$bodyParameter] : null; + // 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 ) { + return $request; + } else { + throw new InvalidArgumentException( + "You must specify a non-null value for the {$bodyParameter} or {$sourceParameter} parameters." ); + } + } + + // update md5 + + public function md5Transformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $operation['data']['contentMd5'] ) ) { + $request = $this->addMd5( $request ); + } + if ( isset( $operation['parameters']['ContentMD5'] ) && + isset( $command['ContentMD5'] ) ) { + $value = $command['ContentMD5']; + if ( $value != false ) { + $request = $this->addMd5( $request ); + } + } + + 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; + } + + // add Header string + + public function headerTransformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $command['Headers'] ) ) { + $headers = $command['Headers']; + foreach ( $headers as $key => $value ) { + $request = $request->withHeader( $key, $value); + } + } + return $request; + } + + // add meta + + public function metadataTransformer( CommandInterface $command, $request ) { + $operation = $this->operation; + if ( isset( $command['Metadata'] ) ) { + $meta = $command['Metadata']; + foreach ( $meta as $key => $value ) { + $request = $request->withHeader( 'x-cos-meta-' . $key, $value ); + } + } + $request = headersMap( $command, $request ); + + return $request; + } + + // count md5 + + private function addMd5( $request ) { + $body = $request->getBody(); + if ( $body && $body->getSize() > 0 ) { + $md5 = base64_encode( md5( $body, true ) ); + return $request->withHeader( 'Content-MD5', $md5 ); + } + return $request; + } + + // inventoryId + + public function specialParamTransformer( CommandInterface $command, $request ) { + $action = $command->getName(); + if ( $action == 'PutBucketInventory' ) { + $id = $command['Id']; + $uri = $request->getUri(); + $query = $uri->getQuery(); + $uri = $uri->withQuery( $query . '&Id='.$id ); + return $request->withUri( $uri ); + } + return $request; + } + + public function ciParamTransformer( CommandInterface $command, $request ) { + $action = $command->getName(); + if ( $action == 'GetObject' ) { + if(str_contains($uri = $request->getUri(), '%21') ) { + $uri = new Uri( str_replace('%21', '!', $uri) ); + $request = $request->withUri( $uri ); + } + if(isset($command['ImageHandleParam']) && $command['ImageHandleParam']){ + $uri = $request->getUri(); + $query = $uri->getQuery(); + if($query){ + $query .= "&" . urlencode($command['ImageHandleParam']); + }else{ + $query .= urlencode($command['ImageHandleParam']); + } + $uri = $uri->withQuery($query); + $request = $request->withUri( $uri ); + } + } + return $request; + } + + public function cosDomain2CiTransformer(CommandInterface $command, $request) { + $action = $command->getName(); + $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']; + } + } + $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() { + } + + } diff --git a/vendor/qcloud/cos-sdk-v5/src/Common.php b/vendor/qcloud/cos-sdk-v5/src/Common.php new file mode 100644 index 0000000..1cc3246 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Common.php @@ -0,0 +1,69 @@ + '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' + ); + if (isset($regionmap[$region])) { + return $regionmap[$region]; + } + return $region; +} + +function encodeKey($key) +{ + return str_replace('%2F', '/', rawurlencode($key)); +} + +function endWith($haystack, $needle) +{ + $length = strlen($needle); + if ($length == 0) { + return true; + } + return (substr($haystack, -$length) === $needle); +} + +function startWith($haystack, $needle) +{ + $length = strlen($needle); + if ($length == 0) { + return true; + } + return (substr($haystack, 0, $length) === $needle); +} + +function headersMap($command, $request) +{ + $headermap = array( + 'TransferEncoding' => 'Transfer-Encoding', + 'ChannelId' => 'x-cos-channel-id' + ); + foreach ($headermap as $key => $value) { + if (isset($command[$key])) { + $request = $request->withHeader($value, $command[$key]); + } + } + return $request; +} + +if (!function_exists('str_contains')) { + function str_contains($haystack, $needle) + { + return strpos($haystack, $needle) !== false; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Copy.php b/vendor/qcloud/cos-sdk-v5/src/Copy.php new file mode 100644 index 0000000..18b3d03 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Copy.php @@ -0,0 +1,140 @@ +client = $client; + $this->copySource = $source; + $this->options = $options; + $this->size = $source['ContentLength']; + unset($source['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 < $this->retry; $i += 1) { + $rt = $this->uploadParts($uploadId); + if ($rt == 0) { + break; + } + sleep(1 << $i); + } + foreach ( $this->parts as $key => $row ){ + $num1[$key] = $row ['PartNumber']; + $num2[$key] = $row ['ETag']; + } + array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts); + return $this->client->completeMultipartUpload(array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'UploadId' => $uploadId, + 'Parts' => $this->parts) + ); + + } + public function uploadParts($uploadId) { + $copyRequests = function ($uploadId) { + $offset = 0; + $partNumber = 1; + $partSize = $this->partSize; + $finishedNum = 0; + $this->parts = array(); + for ($index = 1; ; $index ++) { + if ($offset + $partSize >= $this->size) + { + $partSize = $this->size - $offset; + } + $copySourcePath = $this->copySource['Bucket']. '.cos.'. $this->copySource['Region']. + ".myqcloud.com/". $this->copySource['Key']. "?versionId=". $this->copySource['VersionId']; + $params = array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'UploadId' => $uploadId, + 'PartNumber' => $partNumber, + 'CopySource'=> $copySourcePath, + 'CopySourceRange' => 'bytes='.((string)$offset).'-'.(string)($offset+$partSize - 1), + ); + if(!isset($this->parts[$partNumber])) { + $command = $this->client->getCommand('uploadPartCopy', $params); + $request = $this->client->commandToRequestTransformer($command); + $this->commandList[$index] = $command; + $this->requestList[$index] = $request; + yield $request; + } + ++$partNumber; + $offset += $partSize; + if ($this->size == $offset) { + break; + } + } + }; + $pool = new Pool($this->client->httpClient, $copyRequests($uploadId), [ + 'concurrency' => $this->concurrency, + 'fulfilled' => function ($response, $index) { + $index = $index + 1; + $response = $this->client->responseToResultTransformer($response, $this->requestList[$index], $this->commandList[$index]); + $part = array('PartNumber' => $index, 'ETag' => $response['ETag']); + $this->parts[$index] = $part; + }, + + 'rejected' => function ($reason, $index) { + $index = $index += 1; + $retry = 2; + for ($i = 1; $i <= $retry; $i++) { + try { + $rt =$this->client->execute($this->commandList[$index]); + $part = array('PartNumber' => $index, 'ETag' => $rt['ETag']); + $this->parts[$index] = $part; + } catch(\Exception $e) { + if ($i == $retry) { + throw($e); + } + } + } + }, + ]); + + // Initiate the transfers and create a promise + $promise = $pool->promise(); + + // Force the pool of requests to complete. + $promise->wait(); + } + + + 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']; + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Descriptions.php b/vendor/qcloud/cos-sdk-v5/src/Descriptions.php new file mode 100644 index 0000000..c007eb4 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Descriptions.php @@ -0,0 +1,4963 @@ + 'POST', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateMediaTranscodeJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Tag' => array('location' => 'xml', 'type' => 'string', ), + 'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'WatermarkTemplateId' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'WatermarkTemplateId', + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'WatermarkTemplateId', + ), + ), + 'Transcode' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Container' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Fps' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'Profile' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Crf' => array( 'type' => 'string', 'location' => 'xml', ), + 'Gop' => array( 'type' => 'string', 'location' => 'xml', ), + 'Preset' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ), + 'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ), + 'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TimeInterval' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Start' => array( 'type' => 'string', 'location' => 'xml', ), + 'Duration' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Audio' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ), + 'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ), + 'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TransConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ), + 'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ), + 'HlsEncrypt' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ), + 'UriKey' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + 'Watermark' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Watermark', + 'type' => 'object', + 'sentAs' => 'Watermark', + 'properties' => array( + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'Pos' => array( 'type' => 'string', 'location' => 'xml', ), + 'LocMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dx' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dy' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Image' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Transparency' => array( 'type' => 'string', 'location' => 'xml', ), + 'Background' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Text' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'FontSize' => array( 'type' => 'string', 'location' => 'xml', ), + 'FontType' => array( 'type' => 'string', 'location' => 'xml', ), + 'FontColor' => array( 'type' => 'string', 'location' => 'xml', ), + 'Transparency' => array( 'type' => 'string', 'location' => 'xml', ), + 'Text' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ) + ), + 'RemoveWatermark' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Dx' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dy' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaTranscodeJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function CreateMediaJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateMediaJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Operation', + 'type' => 'object', + 'sentAs' => 'Operation', + 'properties' => array( + 'Tag' => array('location' => 'xml', 'type' => 'string', ), + 'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'TranscodeTemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'VideoProcess' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'ColorEnhance' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Enable' => array( 'type' => 'string', 'location' => 'xml', ), + 'Contrast' => array( 'type' => 'string', 'location' => 'xml', ), + 'Correction' => array( 'type' => 'string', 'location' => 'xml', ), + 'Saturation' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'MsSharpen' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Enable' => array( 'type' => 'string', 'location' => 'xml', ), + 'SharpenLevel' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + 'VideoMontage' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Duration' => array( 'type' => 'string', 'location' => 'xml', ), + 'Container' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Fps' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Crf' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Audio' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + 'Animation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Container' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Fps' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'AnimateOnlyKeepKeyFrame' => array( 'type' => 'string', 'location' => 'xml', ), + 'AnimateTimeIntervalOfFrame' => array( 'type' => 'string', 'location' => 'xml', ), + 'AnimateFramesPerSecond' => array( 'type' => 'string', 'location' => 'xml', ), + 'Quality' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TimeInterval' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Start' => array( 'type' => 'string', 'location' => 'xml', ), + 'Duration' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + 'Snapshot' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Start' => array( 'type' => 'string', 'location' => 'xml', ), + 'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ), + 'Count' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'VoiceSeparate' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'AudioMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'AudioConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + 'Segment' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + 'Duration' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'SDRtoHDR' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HdrMode' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'SuperResolution' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Resolution' => array( 'type' => 'string', 'location' => 'xml', ), + 'EnableScaleUp' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'WatermarkTemplateId' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'WatermarkTemplateId', + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'WatermarkTemplateId', + ), + ), + 'Transcode' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Container' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Fps' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'Profile' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Crf' => array( 'type' => 'string', 'location' => 'xml', ), + 'Gop' => array( 'type' => 'string', 'location' => 'xml', ), + 'Preset' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bufsize' => array( 'type' => 'string', 'location' => 'xml', ), + 'Maxrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'HlsTsTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Pixfmt' => array( 'type' => 'string', 'location' => 'xml', ), + 'LongShortMode' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TimeInterval' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Start' => array( 'type' => 'string', 'location' => 'xml', ), + 'Duration' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Audio' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + 'KeepTwoTracks' => array( 'type' => 'string', 'location' => 'xml', ), + 'SwitchTrack' => array( 'type' => 'string', 'location' => 'xml', ), + 'SampleFormat' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TransConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'AdjDarMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckReso' => array( 'type' => 'string', 'location' => 'xml', ), + 'ResoAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckVideoBitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'VideoBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsCheckAudioBitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'AudioBitrateAdjMethod' => array( 'type' => 'string', 'location' => 'xml', ), + 'DeleteMetadata' => array( 'type' => 'string', 'location' => 'xml', ), + 'IsHdr2Sdr' => array( 'type' => 'string', 'location' => 'xml', ), + 'HlsEncrypt' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'IsHlsEncrypt' => array( 'type' => 'string', 'location' => 'xml', ), + 'UriKey' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + 'Watermark' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Watermark', + 'type' => 'object', + 'sentAs' => 'Watermark', + 'properties' => array( + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'Pos' => array( 'type' => 'string', 'location' => 'xml', ), + 'LocMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dx' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dy' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Image' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Transparency' => array( 'type' => 'string', 'location' => 'xml', ), + 'Background' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Text' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'FontSize' => array( 'type' => 'string', 'location' => 'xml', ), + 'FontType' => array( 'type' => 'string', 'location' => 'xml', ), + 'FontColor' => array( 'type' => 'string', 'location' => 'xml', ), + 'Transparency' => array( 'type' => 'string', 'location' => 'xml', ), + 'Text' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ) + ), + 'RemoveWatermark' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Dx' => array( 'type' => 'string', 'location' => 'xml', ), + 'Dy' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ), + 'AuObject' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ), + 'SpriteObject' => array( 'required' => false, 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function DescribeMediaJob() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DescribeMediaJobOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function DescribeMediaJobOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function DescribeMediaJobs() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DescribeMediaJobsOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Tag' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'tag', + ), + 'QueueId' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'queueId', + ), + 'OrderByTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'orderByTime', + ), + 'NextToken' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'nextToken', + ), + 'Size' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'size', + ), + 'States' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'states', + ), + 'StartCreationTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'startCreationTime', + ), + 'EndCreationTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'endCreationTime', + ), + ), + ); + } + public static function DescribeMediaJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function CreateMediaSnapshotJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateMediaSnapshotJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Snapshot' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Start' => array( 'type' => 'string', 'location' => 'xml', ), + 'TimeInterval' => array( 'type' => 'string', 'location' => 'xml', ), + 'Count' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaSnapshotJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function CreateMediaConcatJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateMediaConcatJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'required' => false, 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' =>false, 'type' => 'string', 'location' => 'xml', ), // 拼接任务Input可以为空,完全用数组内的元素拼接 + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'ConcatTemplate' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Audio' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Index' => array( 'type' => 'string', 'location' => 'xml', ), + 'DirectConcat' => array( 'type' => 'string', 'location' => 'xml', ), + 'ConcatFragments' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'ConcatFragment', + 'type' => 'object', + 'sentAs' => 'ConcatFragment', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'StartTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'EndTime' => array( 'type' => 'string', 'location' => 'xml', ), + // 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), 拼接接口不需要Mode参数 + ), + ), + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Width' => array( 'type' => 'string', 'location' => 'xml', ), + 'Height' => array( 'type' => 'string', 'location' => 'xml', ), + 'Fps' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Remove' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Container' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaConcatJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function DetectAudio() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}audio/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectAudioOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Url' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Object' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'DataId' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Callback' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'BizType' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'CallbackVersion' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + ), + ); + } + public static function DetectAudioOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ), + 'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function GetDetectAudioResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}audio/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectAudioResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + + public static function GetDetectAudioResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'string', 'location' => 'xml', ), + 'Message' => array( 'type' => 'string', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'Result' => array( 'type' => 'integer', 'location' => 'xml', ), + 'AudioText' => array( 'type' => 'string', 'location' => 'xml', ), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Section' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Text' => array( 'type' => 'string', 'location' => 'xml', ), + 'OffsetTime' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Duration' => array( 'type' => 'integer', 'location' => 'xml', ), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetDetectTextResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}text/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectTextResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectTextResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'string', 'location' => 'xml', ), + 'Message' => array( 'type' => 'string', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Content' => array( 'type' => 'string', 'location' => 'xml', ), + 'SectionCount' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'Result' => array( 'type' => 'integer', 'location' => 'xml', ), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'IllegalInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'AbuseInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Count' => array( 'type' => 'integer', 'location' => 'xml', ), + ), + ), + 'Section' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'StartByte' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'Result' => array( 'type' => 'integer', 'location' => 'xml', ), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'IllegalInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'AbuseInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function DetectVideo() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}video/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectVideoOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'Callback' => array( 'type' => 'string', 'location' => 'xml', ), + 'BizType' => array( 'type' => 'string', 'location' => 'xml', ), + 'CallbackVersion' => array( 'type' => 'string', 'location' => 'xml', ), + 'DetectContent' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Snapshot' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Mode' => array( 'type' => 'string', 'location' => 'xml', ), + 'Count' => array( 'type' => 'string', 'location' => 'xml', ), + 'TimeInterval' => array( 'type' => 'numeric', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ); + } + public static function DetectVideoOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ), + 'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function GetDetectVideoResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}video/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectVideoResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectVideoResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'DataId' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'Object' => array('type' => 'string', 'location' => 'xml',), + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'SnapshotCount' => array('type' => 'string', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'Result' => array('type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Count' => array('type' => 'integer', 'location' => 'xml',), + ) + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Count' => array('type' => 'integer', 'location' => 'xml',), + ) + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Count' => array('type' => 'integer', 'location' => 'xml',), + ) + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Count' => array('type' => 'integer', 'location' => 'xml',), + ) + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Count' => array('type' => 'integer', 'location' => 'xml',), + ) + ), + 'Snapshot' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'SnapshotTime' => array('type' => 'integer', 'location' => 'xml',), + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + ) + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + ) + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + ) + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + ) + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ) + ), + ) + ), + ), + ) + ), + ) + ), + ), + 'AudioSection' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'OffsetTime' => array('type' => 'integer', 'location' => 'xml',), + 'Duration' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'Result' => array('type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + ) + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + ) + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + ) + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + ) + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',), + ), + ) + ), + ), + ), + ), + ) + ), + 'NonExistJobIds' => array('type' => 'string', 'location' => 'xml',) + ), + ); + } + + public static function DetectDocument() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}document/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectDocumentOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Type' => array( 'type' => 'string', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'Callback' => array( 'type' => 'string', 'location' => 'xml', ), + 'BizType' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + public static function DetectDocumentOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ), + 'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function GetDetectDocumentResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}document/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectDocumentResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectDocumentResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'DataId' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'Suggestion' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'Object' => array('type' => 'string', 'location' => 'xml',), + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'PageCount' => array('type' => 'integer', 'location' => 'xml',), + 'Labels' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + ), + ), + 'PageSegment' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Results' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'PageNumber' => array('type' => 'integer', 'location' => 'xml',), + 'SheetNumber' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'Suggestion' => array('type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',) + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',) + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',) + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array('type' => 'string', 'location' => 'xml',) + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array('type' => 'numeric', 'location' => 'xml',), + 'Y' => array('type' => 'numeric', 'location' => 'xml',), + 'Height' => array('type' => 'numeric', 'location' => 'xml',), + 'Width' => array('type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array('type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + public static function CreateDocProcessJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}doc_jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateDocProcessJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Tag' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'QueueId' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( + 'type' => 'string','required' => true,'location' => 'xml', + ), + 'Bucket' => array( + 'type' => 'string','required' => true,'location' => 'xml', + ), + 'Object' => array( + 'type' => 'string','required' => true,'location' => 'xml', + ), + ), + ), + 'DocProcess' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'SrcType' => array( + 'type' => 'string', + ), + 'TgtType' => array( + 'type' => 'string', + ), + 'SheetId' => array( + 'type' => 'integer', + ), + 'StartPage' => array( + 'type' => 'integer', + ), + 'EndPage' => array( + 'type' => 'integer', + ), + 'ImageParams' => array( + 'type' => 'string', + ), + 'DocPassword' => array( + 'type' => 'string', + ), + 'Comments' => array( + 'type' => 'integer', + ), + 'PaperDirection' => array( + 'type' => 'integer', + ), + 'Quality' => array( + 'type' => 'integer', + ), + 'Zoom' => array( + 'type' => 'integer', + ), + ), + ), + ), + ), + ), + ); + } + public static function CreateDocProcessJobsOutput() + { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id',), + 'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',), + 'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'EndTime' => array('type' => 'string', 'location' => 'xml',), + 'StartTime' => array('type' => 'string', 'location' => 'xml',), + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'Tag' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'QueueId' => array('type' => 'string', 'location' => 'xml',), + 'Input' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array('type' => 'string', 'location' => 'xml',), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( + 'type' => 'string','location' => 'xml', + ), + 'Bucket' => array( + 'type' => 'string','location' => 'xml', + ), + 'Object' => array( + 'type' => 'string','location' => 'xml', + ), + ), + ), + 'DocProcess' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'SrcType' => array( + 'type' => 'string', + ), + 'TgtType' => array( + 'type' => 'string', + ), + 'SheetId' => array( + 'type' => 'integer', + ), + 'StartPage' => array( + 'type' => 'integer', + ), + 'EndPage' => array( + 'type' => 'integer', + ), + 'ImageParams' => array( + 'type' => 'string', + ), + 'DocPassword' => array( + 'type' => 'string', + ), + 'Comments' => array( + 'type' => 'integer', + ), + 'PaperDirection' => array( + 'type' => 'integer', + ), + 'Quality' => array( + 'type' => 'integer', + ), + 'Zoom' => array( + 'type' => 'integer', + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + public static function DescribeDocProcessQueues() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}docqueue', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DescribeDocProcessQueuesOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'queueIds' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'state' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'pageNumber' => array( + 'type' => 'string', + 'location' => 'query', + ), + 'pageSize' => array( + 'type' => 'string', + 'location' => 'query', + ), + ), + ); + } + public static function DescribeDocProcessQueuesOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array('type' => 'string', 'location' => 'xml',), + 'TotalCount' => array('type' => 'integer', 'location' => 'xml',), + 'PageNumber' => array('type' => 'integer', 'location' => 'xml',), + 'PageSize' => array('type' => 'integer', 'location' => 'xml',), + 'QueueList' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'State' => array('type' => 'string', 'location' => 'xml',), + 'Name' => array('type' => 'string', 'location' => 'xml',), + 'MaxSize' => array('type' => 'integer', 'location' => 'xml',), + 'MaxConcurrent' => array('type' => 'integer', 'location' => 'xml',), + 'CreateTime' => array('type' => 'string', 'location' => 'xml',), + 'UpdateTime' => array('type' => 'string', 'location' => 'xml',), + 'BucketId' => array('type' => 'string', 'location' => 'xml',), + 'Category' => array('type' => 'string', 'location' => 'xml',), + 'QueueId' => array('type' => 'string', 'location' => 'xml',), + 'NotifyConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'Event' => array('type' => 'string', 'location' => 'xml',), + 'Type' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + ), + ), + ), + ), + ), + ); + } + + public static function DescribeDocProcessJob() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}doc_jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DescribeDocProcessJobOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + + public static function DescribeDocProcessJobOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( + 'type' => 'string', + ), + 'Message' => array( + 'type' => 'string', + ), + 'JobId' => array( + 'type' => 'string', + ), + 'State' => array( + 'type' => 'string', + ), + 'CreationTime' => array( + 'type' => 'string', + ), + 'QueueId' => array( + 'type' => 'string', + ), + 'Tag' => array( + 'type' => 'string', + ), + 'EndTime' => array( + 'type' => 'string', + ), + 'Input' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( + 'type' => 'string', + ), + ), + ), + 'Operation' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'DocProcess' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'SrcType' => array( + 'type' => 'string', + ), + 'TgtType' => array( + 'type' => 'string', + ), + 'SheetId' => array( + 'type' => 'integer', + ), + 'StartPage' => array( + 'type' => 'integer', + ), + 'EndPage' => array( + 'type' => 'integer', + ), + 'ImageParams' => array( + 'type' => 'string', + ), + 'DocPassword' => array( + 'type' => 'string', + ), + 'Comments' => array( + 'type' => 'integer', + ), + 'PaperDirection' => array( + 'type' => 'integer', + ), + 'Quality' => array( + 'type' => 'integer', + ), + 'Zoom' => array( + 'type' => 'integer', + ), + ), + ), + 'DocProcessResult' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'PageInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'PageNo' => array( + 'type' => 'integer', + ), + 'TgtUri' => array( + 'type' => 'string', + ), + 'PicIndex' => array( + 'type' => 'integer', + ), + 'PicNum' => array( + 'type' => 'integer', + ), + 'X-SheetPics' => array( + 'type' => 'integer', + ), + ), + ), + 'SuccPageCount' => array( + 'type' => 'integer', + ), + 'FailPageCount' => array( + 'type' => 'integer', + ), + 'TaskId' => array( + 'type' => 'string', + ), + 'TgtType' => array( + 'type' => 'string', + ), + 'TotalPageCount' => array( + 'type' => 'integer', + ), + 'TotalSheetCount' => array( + 'type' => 'integer', + ), + ), + ), + 'Output' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Bucket' => array( + 'type' => 'string', + ), + 'Object' => array( + 'type' => 'string', + ), + 'Region' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetDescribeDocProcessJobs() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}doc_jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDescribeDocProcessJobsOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Tag' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'tag', + ), + 'QueueId' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'queueId', + ), + 'OrderByTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'orderByTime', + ), + 'NextToken' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'nextToken', + ), + 'Size' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'size', + ), + 'States' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'states', + ), + 'StartCreationTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'startCreationTime', + ), + 'EndCreationTime' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'endCreationTime', + ), + ), + ); + } + + public static function GetDescribeDocProcessJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id',), + 'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',), + 'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',), + 'NextToken' => array('type' => 'string','location' => 'xml',), + 'JobsDetail' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'Tag' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'QueueId' => array('type' => 'string', 'location' => 'xml',), + 'Input' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array('type' => 'string', 'location' => 'xml',), + ), + ), + 'Operation' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array( + 'type' => 'string','location' => 'xml', + ), + 'Bucket' => array( + 'type' => 'string','location' => 'xml', + ), + 'Object' => array( + 'type' => 'string','location' => 'xml', + ), + ), + ), + 'DocProcess' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'SrcType' => array( + 'type' => 'string', + ), + 'TgtType' => array( + 'type' => 'string', + ), + 'SheetId' => array( + 'type' => 'integer', + ), + 'StartPage' => array( + 'type' => 'integer', + ), + 'EndPage' => array( + 'type' => 'integer', + ), + 'ImageParams' => array( + 'type' => 'string', + ), + 'DocPassword' => array( + 'type' => 'string', + ), + 'Comments' => array( + 'type' => 'integer', + ), + 'PaperDirection' => array( + 'type' => 'integer', + ), + 'Quality' => array( + 'type' => 'integer', + ), + 'Zoom' => array( + 'type' => 'integer', + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function DetectImage() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectImageOutput', + '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' + ) + ), + 'ci-process' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query' + ), + 'DetectType' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'detect-type' + ), + 'DetectUrl' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'detect-url' + ), + 'Interval' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'interval' + ), + 'MaxFrames' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'max-frames' + ), + 'BizType' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'biz-type' + ) + ), + ); + } + + public static function DetectImageOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-cos-request-id', ), + 'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',), + 'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',), + 'Result' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'CompressionResult' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerroristInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ) + ); + } + + public static function DetectImages() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}image/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectImagesOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Inputs' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Input', + 'type' => 'object', + 'location' => 'xml', + 'sentAs' => 'Input', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'Interval' => array( 'type' => 'integer', 'location' => 'xml', ), + 'MaxFrames' => array( 'type' => 'integer', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + 'Conf' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'BizType' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function DetectImagesOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array('type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type',), + 'ContentLength' => array('type' => 'numeric', 'minimum' => 0, 'location' => 'header', 'sentAs' => 'Content-Length',), + 'JobsDetail' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'string', 'location' => 'xml',), + 'Message' => array( 'type' => 'string', 'location' => 'xml',), + 'JobId' => array( 'type' => 'string', 'location' => 'xml',), + 'DataId' => array( 'type' => 'string', 'location' => 'xml',), + 'CompressionResult' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'Result' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Object' => array( 'type' => 'string', 'location' => 'xml',), + 'Url' => array( 'type' => 'string', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'integer', 'location' => 'xml',), + 'Msg' => array( 'type' => 'string', 'location' => 'xml',), + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ) + ); + } + + public static function DetectVirus() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}virus/detect', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectVirusOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Object' => array( 'type' => 'string', 'location' => 'xml', ), + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'Callback' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + public static function DetectVirusOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ), + 'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function GetDetectVirusResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}virus/detect/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectVirusResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectVirusResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'Object' => array('type' => 'string', 'location' => 'xml',), + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'Suggestion' => array('type' => 'string', 'location' => 'xml',), + 'DetectDetail' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Result' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'FileName' => array( 'type' => 'string', 'location' => 'xml', ), + 'VirusName' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function GetDetectImageResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}image/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectImageResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectImageResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'Object' => array('type' => 'string', 'location' => 'xml',), + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'CompressionResult' => array('type' => 'integer', 'location' => 'xml',), + 'Text' => array('type' => 'string', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'Result' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TeenagerInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Score' => array( 'type' => 'integer', 'location' => 'xml', ), + 'Label' => array( 'type' => 'string', 'location' => 'xml', ), + 'SubLabel' => array( 'type' => 'string', 'location' => 'xml', ), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaVoiceSeparateJobs() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}jobs', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'CreateMediaVoiceSeparateJobsOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( 'required' => true, 'type' => 'string', 'location' => 'uri', ), + 'Tag' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'QueueId' => array( 'required' => true, 'location' => 'xml', 'type' => 'string', ), + 'CallBack' => array( 'location' => 'xml', 'type' => 'string', ), + 'Input' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( 'required' => true, 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Operation' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'TemplateId' => array( 'type' => 'string', 'location' => 'xml', ), + 'VoiceSeparate' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'AudioMode' => array( 'type' => 'string', 'location' => 'xml', ), + 'AudioConfig' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Codec' => array( 'type' => 'string', 'location' => 'xml', ), + 'Samplerate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Bitrate' => array( 'type' => 'string', 'location' => 'xml', ), + 'Channels' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + 'Output' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Region' => array('type' => 'string', 'location' => 'xml', ), + 'Bucket' => array('type' => 'string', 'location' => 'xml', ), + 'Object' => array('type' => 'string', 'location' => 'xml', ), + 'AuObject' => array('type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + ), + ); + } + + public static function CreateMediaVoiceSeparateJobsOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function DescribeMediaVoiceSeparateJob() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}jobs/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DescribeMediaVoiceSeparateJobOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function DescribeMediaVoiceSeparateJobOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ); + } + + public static function DetectWebpage() { + return array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}webpage/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectWebpageOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml', ), + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'Callback' => array( 'type' => 'string', 'location' => 'xml', ), + 'ReturnHighlightHtml' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + public static function DetectWebpageOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'x-ci-request-id', ), + 'ContentType' => array( 'type' => 'string', 'location' => 'header', 'sentAs' => 'Content-Type', ), + 'ContentLength' => array( 'type' => 'numeric', 'minimum'=> 0, 'location' => 'header', 'sentAs' => 'Content-Length', ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'DataId' => array( 'type' => 'string', 'location' => 'xml', ), + 'JobId' => array( 'type' => 'string', 'location' => 'xml', ), + 'State' => array( 'type' => 'string', 'location' => 'xml', ), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ); + } + + public static function GetDetectWebpageResult() { + return array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}webpage/auditing/{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetDetectWebpageResultOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ); + } + public static function GetDetectWebpageResultOutput() { + return array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array('type' => 'string', 'location' => 'xml',), + 'Message' => array('type' => 'string', 'location' => 'xml',), + 'DataId' => array('type' => 'string', 'location' => 'xml',), + 'JobId' => array('type' => 'string', 'location' => 'xml',), + 'State' => array('type' => 'string', 'location' => 'xml',), + 'CreationTime' => array('type' => 'string', 'location' => 'xml',), + 'Url' => array('type' => 'string', 'location' => 'xml',), + 'Suggestion' => array('type' => 'integer', 'location' => 'xml',), + 'Label' => array('type' => 'string', 'location' => 'xml',), + 'PageCount' => array('type' => 'integer', 'location' => 'xml',), + 'HighlightHtml' => array('type' => 'string', 'location' => 'xml',), + 'Labels' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + ), + ), + ), + ), + 'ImageResults' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Results' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Url' => array( 'type' => 'string', 'location' => 'xml',), + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'Suggestion' => array( 'type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'SubLabel' => array('type' => 'string', 'location' => 'xml',), + 'OcrResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Keywords' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( 'type' => 'string', 'location' => 'xml',), + ), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + 'ObjectResults' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Name' => array( 'type' => 'string', 'location' => 'xml',), + 'Location' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'X' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Y' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Width' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Height' => array( 'type' => 'numeric', 'location' => 'xml',), + 'Rotate' => array( 'type' => 'numeric', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + 'TextResults' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Results' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Text' => array( 'type' => 'string', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'Suggestion' => array( 'type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array('type' => 'string', 'location' => 'xml',), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array('type' => 'string', 'location' => 'xml',), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array('type' => 'string', 'location' => 'xml',), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array('type' => 'integer', 'location' => 'xml',), + 'Score' => array('type' => 'integer', 'location' => 'xml',), + 'Keywords' => array('type' => 'string', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ); + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php b/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php new file mode 100644 index 0000000..8e482c6 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Exception/CosException.php @@ -0,0 +1,5 @@ +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 + */ + public function setResponse(ResponseInterface $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')[0]; + } + + 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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php b/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php new file mode 100644 index 0000000..3bc980a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ExceptionMiddleware.php @@ -0,0 +1,71 @@ +nextHandler = $nextHandler; + $this->parser = new ExceptionParser(); + $this->defaultException = 'Qcloud\Cos\Exception\ServiceResponseException'; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) { + $fn = $this->nextHandler; + return $fn($request, $options)->then( + function (ResponseInterface $response) use ($request) { + return $this->handle($request, $response); + } + ); + } + + public function handle(RequestInterface $request, ResponseInterface $response) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + + //throw RequestException::create($request, $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; + + throw $this->createException($className, $request, $response, $parts); + } + + protected function createException($className, RequestInterface $request, ResponseInterface $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; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php b/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php new file mode 100644 index 0000000..c15400b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ExceptionParser.php @@ -0,0 +1,112 @@ + null, + 'message' => null, + //'type' => $response->isClientError() ? 'client' : 'server', + 'type' => 'client', + 'request_id' => null, + 'parsed' => null + ); + + $body = strval($response->getBody()); + + if (empty($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, ResponseInterface $response, array &$data) { + $data['message'] = $response->getStatusCode() . ' ' . $response->getReasonPhrase(); + $requestId = $response->getHeader('x-cos-request-id'); + if (isset($requestId[0])) { + $requestId = $requestId[0]; + $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->getUri()->getPath(), '/')); + $host = explode('.', $request->getUri()->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]; + } + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php new file mode 100644 index 0000000..0f03b1e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/BlindWatermarkTemplate.php @@ -0,0 +1,87 @@ +markType = 3; + $this->type = ""; + $this->image = ""; + $this->text = ""; + $this->level = ""; + + } + + public function setPick() { + $this->markType = 4; + } + + public function setType($value) { + $this->type = "/type/" . $value; + } + + public function setImage($value) { + $this->image = "/image/" . $this->ciBase64($value); + } + + public function setText($value) { + $this->text = "/text/" . $this->ciBase64($value); + } + + public function setLevel($value) { + $this->level = "/level/" . $value; + } + + public function getType() { + return $this->type; + } + + public function getImage() { + return $this->image; + } + + public function getText() { + return $this->text; + } + + public function getLevel() { + return $this->level; + } + + + public function queryString() { + $head = "watermark/$this->markType"; + $res = ""; + if($this->type){ + $res .= $this->type; + } + if($this->image){ + $res .= $this->image; + } + if($this->text){ + $res .= $this->text; + } + if($this->level){ + $res .= $this->level; + } + if($res){ + $res = $head . $res; + } + return $res; + } + + public function resetRule() { + $this->markType = 3; + $this->type = ""; + $this->image = ""; + $this->text = ""; + $this->level = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php new file mode 100644 index 0000000..0ee780a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/CIParamTransformation.php @@ -0,0 +1,39 @@ +spilt = $spilt; + $this->tranParams = array(); + $this->tranString = ""; + } + + public function addRule(ImageTemplate $template) { + if($template->queryString()){ + $this->tranParams[] = $template->queryString(); + } + } + + public function queryString() { + if($this->tranParams) { + $this->tranString = implode($this->spilt, $this->tranParams); + } + return $this->tranString; + } + + public function resetRule() { + $this->tranParams = array(); + $this->tranString = ""; + } + + public function defineRule($value) { + $this->tranParams[] = $value; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php new file mode 100644 index 0000000..eacf677 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageMogrTemplate.php @@ -0,0 +1,159 @@ +tranParams = array(); + $this->tranString = ""; + } + + public function thumbnailByScale($widthScale) { + $this->tranParams[] = "/thumbnail/!" . $widthScale . "p"; + } + + public function thumbnailByWidthScale($heightScale) { + $this->tranParams[] = "/thumbnail/!" . $heightScale . "px"; + } + + public function thumbnailByHeightScale($scale) { + $this->tranParams[] = "/thumbnail/!x" . $scale . "p"; + } + + public function thumbnailByWidth($width) { + $this->tranParams[] = "/thumbnail/" . $width . "x"; + } + + public function thumbnailByHeight($height) { + $this->tranParams[] = "/thumbnail/x" . $height; + } + + public function thumbnailByMaxWH($maxW, $maxH) { + $this->tranParams[] = "/thumbnail/" . $maxW . "x" . $maxH; + } + + public function thumbnailByMinWH($minW, $minH) { + $this->tranParams[] = "/thumbnail/!" . $minW . "x" . $minH . "r" ; + } + + public function thumbnailByWH($width, $height) { + $this->tranParams[] = "/thumbnail/" . $width . "x" . $height . "!"; + } + + public function thumbnailByPixel($pixel) { + $this->tranParams[] = "/thumbnail/" . $pixel . "@"; + } + + public function cut($width, $height, $dx, $dy) { + $this->tranParams[] = "/cut/" . $width . "x" . "$height" . "x" . $dx . "x" . $dy; + } + + public function cropByWidth($width, $gravity = "") { + $temp = "/crop/" . $width . "x"; + if($gravity){ + $temp .= "/gravity/" . $gravity; + } + $this->tranParams[] = $temp; + } + + public function cropByHeight($height, $gravity = "") { + $temp = "/crop/x" . $height; + if($gravity){ + $temp .= "/gravity/" . $gravity; + } + $this->tranParams[] = $temp; + } + + public function cropByWH($width, $height, $gravity = "") { + $temp = "/crop/" . $width . "x" . $height; + if($gravity){ + $temp .= "/gravity/" . $gravity; + } + $this->tranParams[] = $temp; + } + + public function iradius($radius) { + $this->tranParams[] = "/iradius/" . $radius; + } + + public function rradius($radius) { + $this->tranParams[] = "/rradius/" . $radius; + } + + public function scrop($width, $height) { + $this->tranParams[] = "/scrop/" . $width . "x" . $height; + } + + public function rotate($degree) { + $this->tranParams[] = "/rotate/" . $degree; + } + + public function autoOrient() { + $this->tranParams[] = "/rotate/auto-orient"; + } + + public function format($format) { + $this->tranParams[] = "/format/" . $format; + } + + public function gifOptimization($frameNumber) { + $this->tranParams[] = "/cgif/" . $frameNumber; + } + + public function jpegInterlaceMode($mode) { + $this->tranParams[] = "/interlace/" . $mode; + } + + public function quality($value, $force = 0) { + $temp = "/quality/" . $value; + if($force){ + $temp .= "!"; + } + $this->tranParams[] = $temp; + } + + public function lowestQuality($value) { + $this->tranParams[] = "/lquality/" . $value; + } + + public function relativelyQuality($value) { + $this->tranParams[] = "/rquality/" . $value; + } + + public function blur($radius, $sigma) { + $this->tranParams[] = "/blur/" . $radius . "x" . $sigma; + } + + public function bright($value) { + $this->tranParams[] = "/bright/" . $value; + } + + public function contrast($value) { + $this->tranParams[] = "/contrast/" . $value; + } + + public function sharpen($value) { + $this->tranParams[] = "/sharpen/" . $value; + } + + public function strip() { + $this->tranParams[] = "/strip"; + } + + public function queryString() { + if($this->tranParams) { + $this->tranString = "imageMogr2" . implode("", $this->tranParams); + } + return $this->tranString; + } + + public function resetRule() { + $this->tranString = ""; + $this->tranParams = array(); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php new file mode 100644 index 0000000..606168b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php @@ -0,0 +1,37 @@ +mode = ""; + } + + public function setMode($mode) { + $this->mode = "/cover/" . $mode; + } + + public function getMode() { + return $this->mode; + } + + public function queryString() { + $head = "QRcode"; + $res = ""; + if($this->mode) { + $res .= $this->mode; + } + if($res) { + $res = $head . $res; + } + return $res; + } + + public function resetRule() { + $this->mode = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php new file mode 100644 index 0000000..c8fa533 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageStyleTemplate.php @@ -0,0 +1,33 @@ +style = ""; + } + + public function setStyle($styleName) { + $this->style = "style/" . $styleName; + } + + public function getStyle() { + return $this->style; + } + + public function queryString() { + $res = ""; + if($this->style) { + $res = $this->style; + } + return $res; + } + + public function resetRule() { + $this->style = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php new file mode 100644 index 0000000..eabe676 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageTemplate.php @@ -0,0 +1,18 @@ +mode = ""; + $this->width = ""; + $this->height = ""; + $this->format = ""; + $this->quality = ""; + } + + public function setMode($value) { + $this->mode = "/" . $value; + } + + public function setWidth($value) { + $this->width = "/w/" . $value; + } + + public function setHeight($value) { + $this->height = "/h/" . $value; + } + + public function setFormat($value) { + $this->format = "/format/" . $value; + } + + public function setQuality($qualityType, $qualityValue, $force = 0) { + if($qualityType == 1){ + $this->quality = "/q/$qualityValue" ; + if($force){ + $this->quality .= "!"; + } + }else if($qualityType == 2){ + $this->quality = "/rq/$qualityValue" ; + }else if ($qualityType == 3){ + $this->quality = "/lq/$qualityValue" ; + } + } + + public function getMode() { + return $this->mode; + } + + public function getWidth() { + return $this->width; + } + + public function getHeight() { + return $this->height; + } + + public function getFormat() { + return $this->format; + } + + public function getQuality() { + return $this->quality; + } + + public function queryString() { + $head = "imageView2"; + $res = ""; + if($this->mode) { + $res .= $this->mode; + } + if($this->width) { + $res .= $this->width; + } + if($this->height) { + $res .= $this->height; + } + if($this->format) { + $res .= $this->format; + } + if($this->quality) { + $res .= $this->quality; + } + if($res) { + $res = $head . $res; + } + return $res; + } + + public function resetRule() { + $this->mode = ""; + $this->width = ""; + $this->height = ""; + $this->format = ""; + $this->quality = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php new file mode 100644 index 0000000..d9f4c5a --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageWatermarkTemplate.php @@ -0,0 +1,122 @@ +image = ""; + $this->gravity = ""; + $this->dx = ""; + $this->dy = ""; + $this->blogo = ""; + $this->scatype = ""; + $this->spcent = ""; + } + + public function setImage($value) { + $this->image = "/image/" . $this->ciBase64($value); + } + + public function setGravity($value) { + $this->gravity = "/gravity/" . $value; + } + + public function setDx($value) { + $this->dx = "/dx/" . $value; + } + + public function setDy($value) { + $this->dy = "/dy/" . $value; + } + + public function setBlogo($value) { + $this->blogo = "/blogo/" . $value; + } + + public function setScatype($value) { + $this->scatype = "/scatype/" . $value; + } + + public function setSpcent($value) { + $this->spcent = "/spcent/" . $value; + } + + public function getImage() { + return $this->image; + } + + public function getGravity() { + return $this->gravity; + } + + public function getDx() { + return $this->dx; + } + + public function getDy() { + return $this->dy; + } + + public function getBlogo() { + return $this->blogo; + } + + public function getScatype() { + return $this->scatype; + } + + public function getSpcent() { + return $this->spcent; + } + + public function queryString() { + $head = "watermark/1"; + $res = ""; + if($this->image) { + $res .= $this->image; + } + if($this->gravity) { + $res .= $this->gravity; + } + if($this->dx) { + $res .= $this->dx; + } + if($this->dy) { + $res .= $this->dy; + } + if($this->blogo) { + $res .= $this->blogo; + } + if($this->scatype) { + $res .= $this->scatype; + } + if($this->spcent) { + $res .= $this->spcent; + } + if($res) { + $res = $head . $res; + } + return $res; + } + + public function resetRule() { + $this->image = ""; + $this->gravity = ""; + $this->dx = ""; + $this->dy = ""; + $this->blogo = ""; + $this->scatype = ""; + $this->spcent = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php new file mode 100644 index 0000000..b10f5d5 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/PicOperationsTransformation.php @@ -0,0 +1,60 @@ +isPicInfo = 0; + $this->rules = array(); + } + + public function setIsPicInfo($value) { + $this->isPicInfo = $value; + } + + public function addRule(ImageTemplate $template, $fileid = "", $bucket = "") { + $rule = $template->queryString(); + if($rule){ + $item = array(); + $item['rule'] = $rule; + if($fileid){ + $item['fileid'] = $fileid; + } + if($bucket) { + $item['bucket'] = $bucket; + } + $this->rules[] = $item; + } + } + + public function getIsPicInfo() { + return $this->isPicInfo; + } + + public function getRules() { + return $this->rules; + } + + public function queryString() { + $res = ""; + $picOperations = array(); + if($this->isPicInfo){ + $picOperations['is_pic_info'] = $this->isPicInfo; + } + if($this->rules){ + $picOperations['rules'] = $this->rules; + } + if($picOperations){ + $res = json_encode($picOperations); + } + return $res; + } + + public function resetRule() { + $this->isPicInfo = 0; + $this->rules = array(); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php new file mode 100644 index 0000000..f1561a7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/TextWatermarkTemplate.php @@ -0,0 +1,166 @@ +text = ""; + $this->font = ""; + $this->fontsize = ""; + $this->fill = ""; + $this->dissolve = ""; + $this->gravity = ""; + $this->dx = ""; + $this->dy = ""; + $this->batch = ""; + $this->degree = ""; + } + + public function setText($value) { + $this->text = "/text/" . $this->ciBase64($value); + } + + public function setFont($value) { + $this->font = "/font/" . $this->ciBase64($value); + } + + public function setFontsize($value) { + $this->fontsize = "/fontsize/" . $value; + } + + public function setFill($value) { + $this->fill = "/fill/" . $this->ciBase64($value); + } + + public function setDissolve($value) { + $this->dissolve = "/dissolve/" . $value; + } + + public function setGravity($value) { + $this->gravity = "/gravity/" . $value; + } + + public function setDx($value) { + $this->dx = "/dx/" . $value; + } + + public function setDy($value) { + $this->dy = "/dy/" . $value; + } + + public function setBatch($value) { + $this->batch = "/batch/" . $value; + } + + public function setDegree($value) { + $this->degree = "/degree/" . $value; + } + + public function getText() { + return $this->text; + } + + public function getFont() { + return $this->font; + } + + public function getFontsize() { + return $this->fontsize; + } + + public function getFill() { + return $this->fill; + } + + public function getDissolve() { + return $this->dissolve; + } + + public function getGravity() { + return $this->gravity; + } + + public function getDx() { + return $this->dx; + } + + public function getDy() { + return $this->dy; + } + + public function getBatch() { + return $this->batch; + } + + public function getDegree() { + return $this->degree; + } + + public function queryString() { + $head = "watermark/2"; + $res = ""; + if($this->text) { + $res .= $this->text; + } + if($this->font) { + $res .= $this->font; + } + if($this->fontsize) { + $res .= $this->fontsize; + } + if($this->fill) { + $res .= $this->fill; + } + if($this->dissolve) { + $res .= $this->dissolve; + } + if($this->gravity) { + $res .= $this->gravity; + } + if($this->dx) { + $res .= $this->dx; + } + if($this->dy) { + $res .= $this->dy; + } + if($this->batch) { + $res .= $this->batch; + } + if($this->degree) { + $res .= $this->degree; + } + if($res) { + $res = $head . $res; + } + return $res; + } + + public function resetRule() { + $this->text = ""; + $this->font = ""; + $this->fontsize = ""; + $this->fill = ""; + $this->dissolve = ""; + $this->gravity = ""; + $this->dx = ""; + $this->dy = ""; + $this->batch = ""; + $this->degree = ""; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php b/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php new file mode 100644 index 0000000..2eec9c0 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/MultipartUpload.php @@ -0,0 +1,167 @@ +body = $body; + $this->client = $client; + $this->options = $options; + $this->partSize = $this->calculatePartSize($minPartSize); + $this->concurrency = isset($options['Concurrency']) ? $options['Concurrency'] : 10; + $this->progress = isset($options['Progress']) ? $options['Progress'] : function($totalSize, $uploadedSize) {}; + $this->parts = []; + $this->partNumberList = []; + $this->uploadedSize = 0; + $this->totalSize = $this->body->getSize(); + $this->needMd5 = isset($options['ContentMD5']) ? $options['ContentMD5'] : true; + $this->retry = isset($options['Retry']) ? $options['Retry'] : 3; + } + public function performUploading() { + $uploadId= $this->initiateMultipartUpload(); + $this->uploadParts($uploadId); + foreach ( $this->parts as $key => $row ){ + $num1[$key] = $row ['PartNumber']; + $num2[$key] = $row ['ETag']; + } + array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts); + return $this->client->completeMultipartUpload(array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'UploadId' => $uploadId, + 'Parts' => $this->parts) + ); + + } + public function uploadParts($uploadId) { + $uploadRequests = function ($uploadId) { + $partNumber = 1; + $index = 1; + $offset = 0; + $partSize = 0; + for ( ; ; $partNumber ++) { + if ($this->body->eof()) { + break; + } + $body = $this->body->read($this->partSize); + $partSize = $this->partSize; + if ($offset + $this->partSize >= $this->totalSize) { + $partSize = $this->totalSize - $offset; + } + $offset += $partSize; + if (empty($body)) { + break; + } + if (isset($this->parts[$partNumber])) { + continue; + } + $this->partNumberList[$index]['PartNumber'] = $partNumber; + $this->partNumberList[$index]['PartSize'] = $partSize; + $params = array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'UploadId' => $uploadId, + 'PartNumber' => $partNumber, + 'Body' => $body, + 'ContentMD5' => $this->needMd5 + ); + if ($this->needMd5 == false) { + unset($params["ContentMD5"]); + } + if (!isset($this->parts[$partNumber])) { + $command = $this->client->getCommand('uploadPart', $params); + $request = $this->client->commandToRequestTransformer($command); + $index ++; + yield $request; + } + } + }; + $pool = new Pool($this->client->httpClient, $uploadRequests($uploadId), [ + 'concurrency' => $this->concurrency, + 'fulfilled' => function ($response, $index) { + $index = $index + 1; + $partNumber = $this->partNumberList[$index]['PartNumber']; + $partSize = $this->partNumberList[$index]['PartSize']; + + //兼容两种写法,防止index为undefined + if (array_key_exists('etag', $response->getHeaders())) { + $etag = $response->getHeaders()["etag"][0]; + } + + if (array_key_exists('ETag', $response->getHeaders())) { + $etag = $response->getHeaders()["ETag"][0]; + } + $part = array('PartNumber' => $partNumber, 'ETag' => $etag); + $this->parts[$partNumber] = $part; + $this->uploadedSize += $partSize; + call_user_func_array($this->progress, [$this->totalSize, $this->uploadedSize]); + }, + + 'rejected' => function ($reason, $index) { + printf("part [%d] upload failed, reason: %s\n", $index, $reason); + throw($reason); + } + ]); + $promise = $pool->promise(); + $promise->wait(); + } + + public function resumeUploading() { + $uploadId = $this->options['UploadId']; + $rt = $this->client->ListParts( + array('UploadId' => $uploadId, + 'Bucket'=>$this->options['Bucket'], + 'Key'=>$this->options['Key'])); + $parts = array(); + if (count($rt['Parts']) > 0) { + foreach ($rt['Parts'] as $part) { + $this->parts[$part['PartNumber']] = array('PartNumber' => $part['PartNumber'], 'ETag' => $part['ETag']); + } + } + $this->uploadParts($uploadId); + foreach ( $this->parts as $key => $row ){ + $num1[$key] = $row ['PartNumber']; + $num2[$key] = $row ['ETag']; + } + array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts); + return $this->client->completeMultipartUpload(array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'UploadId' => $uploadId, + 'Parts' => $this->parts) + ); + } + + private function calculatePartSize($minPartSize) + { + $partSize = intval(ceil(($this->body->getSize() / 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']; + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php b/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php new file mode 100644 index 0000000..77f50f7 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/RangeDownload.php @@ -0,0 +1,145 @@ +client = $client; + $this->options = $options; + $this->partSize = isset( $options['PartSize'] ) ? $options['PartSize'] : self::DEFAULT_PART_SIZE; + $this->concurrency = isset( $options['Concurrency'] ) ? $options['Concurrency'] : 10; + $this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totalSize, $downloadedSize ) { + } + ; + $this->parts = []; + $this->partNumberList = []; + $this->downloadedSize = 0; + $this->totalSize = $contentLength; + $this->saveAs = $saveAs; + $this->resumableJson = []; + $this->resumableJson = isset( $options['ResumableJson'] ) ? $options['ResumableJson'] : []; + unset( $options['ResumableJson'] ); + $this->resumableTaskFile = isset( $options['ResumableTaskFile'] ) ? $options['ResumableTaskFile'] : $saveAs . '.cosresumabletask'; + $this->resumableDownload = isset( $options['ResumableDownload'] ) ? $options['ResumableDownload'] : false; + } + + public function performdownloading() { + if ( $this->resumableDownload ) { + try { + if ( file_exists( $this->resumableTaskFile ) ) { + $origin_content = file_get_contents( $this->resumableTaskFile ); + $this->resumableJsonLocal = json_decode( $origin_content, true ); + if ( $this->resumableJsonLocal == null ) { + $this->resumableJsonLocal = []; + } else if ( $this->resumableJsonLocal['LastModified'] != $this->resumableJson['LastModified'] || + $this->resumableJsonLocal['ContentLength'] != $this->resumableJson['ContentLength'] || + $this->resumableJsonLocal['ETag'] != $this->resumableJson['ETag'] || + $this->resumableJsonLocal['Crc64ecma'] != $this->resumableJson['Crc64ecma'] ) { + $this->resumableDownload = false; + } + } + } catch ( \Exception $e ) { + $this->resumableDownload = false; + } + } + try { + if ($this->resumableDownload) { + $this->fp = fopen( $this->saveAs, 'r+' ); + } else { + $this->fp = fopen( $this->saveAs, 'wb' ); + } + $rt = $this->donwloadParts(); + $this->resumableJson['DownloadedBlocks'] = []; + if (file_exists( $this->resumableTaskFile )) { + unlink($this->resumableTaskFile); + } + } catch ( \Exception $e ) { + $this->fp_resume = fopen( $this->resumableTaskFile, 'wb' ); + fwrite( $this->fp_resume, json_encode( $this->resumableJson ) ); + fclose( $this->fp_resume ); + throw ( $e ); + } + finally { + fclose( $this->fp ); + } + return $rt; + } + + public function donwloadParts() { + $uploadRequests = function () { + $index = 1; + $partSize = 0; + for ( $offset = 0; $offset < $this->totalSize; ) { + $partSize = $this->partSize; + if ( $offset + $this->partSize >= $this->totalSize ) { + $partSize = $this->totalSize - $offset; + } + $this->parts[$index]['PartSize'] = $partSize; + $this->parts[$index]['Offset'] = $offset; + $begin = $offset; + $end = $offset + $partSize - 1; + if ( !( $this->resumableDownload && + isset( $this->resumableJsonLocal['DownloadedBlocks'] ) && + in_array( ['from' => $begin, 'to' => $end], $this->resumableJsonLocal['DownloadedBlocks'] ) ) ) { + $params = array( + 'Bucket' => $this->options['Bucket'], + 'Key' => $this->options['Key'], + 'Range' => sprintf( 'bytes=%d-%d', $begin, $end ) + ); + $command = $this->client->getCommand( 'getObject', $params ); + $request = $this->client->commandToRequestTransformer( $command ); + $index += 1; + yield $request; + } else { + $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end]; + $this->downloadedSize += $partSize; + call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] ); + } + $offset += $partSize; + } + + } + ; + + $pool = new Pool( $this->client->httpClient, $uploadRequests(), [ + 'concurrency' => $this->concurrency, + 'fulfilled' => function ( $response, $index ) { + $index = $index + 1; + $stream = $response->getBody(); + $offset = $this->parts[$index]['Offset']; + $partsize = 8192; + $begin = $offset; + fseek( $this->fp, $offset ); + while ( !$stream->eof() ) { + $output = $stream->read( $partsize ); + $writeLen = fwrite( $this->fp, $output ); + $offset += $writeLen; + } + $end = $offset - 1; + $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end]; + $partSize = $this->parts[$index]['PartSize']; + $this->downloadedSize += $partSize; + call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] ); + } + , + 'rejected' => function ( $reason, $index ) { + throw( $reason ); + } + ] ); + $promise = $pool->promise(); + $promise->wait(); + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php b/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php new file mode 100644 index 0000000..73787fd --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Request/BodyLocation.php @@ -0,0 +1,49 @@ +getBody()->getContents(); + if ('' !== $value) { + throw new \RuntimeException('Only one "body" location may exist per operation'); + } + // binary string data from bound parameter + $value = $command[$param->getName()]; + return $request->withBody(Psr7\Utils::streamFor($value)); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php b/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php new file mode 100644 index 0000000..70f22fa --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/ResultTransformer.php @@ -0,0 +1,187 @@ +config = $config; + $this->operation = $operation; + } + + public function writeDataToLocal(CommandInterface $command, RequestInterface $request, ResponseInterface $response) { + $action = $command->getName(); + if ($action == "GetObject" || $action == "GetSnapshot") { + if (isset($command['SaveAs'])) { + $fp = fopen($command['SaveAs'], "wb"); + $stream = $response->getBody(); + $offset = 0; + $partsize = 8192; + while (!$stream->eof()) { + $output = $stream->read($partsize); + fseek($fp, $offset); + fwrite($fp, $output); + $offset += $partsize; + } + fclose($fp); + } + } + } + + public function metaDataTransformer(CommandInterface $command, ResponseInterface $response, Result $result) { + $headers = $response->getHeaders(); + $metadata = array(); + foreach ($headers as $key => $value) { + if (strpos($key, "x-cos-meta-") === 0) { + $metadata[substr($key, 11)] = $value[0]; + } + } + if (!empty($metadata)) { + $result['Metadata'] = $metadata; + } + return $result; + } + + public function extraHeadersTransformer(CommandInterface $command, RequestInterface $request, Result $result) { + if ($command['Key'] != null && $result['Key'] == null) { + $result['Key'] = $command['Key']; + } + if ($command['Bucket'] != null && $result['Bucket'] == null) { + $result['Bucket'] = $command['Bucket']; + } + $result['Location'] = $request->getHeader("Host")[0] . $request->getUri()->getPath(); + return $result; + } + + public function selectContentTransformer(CommandInterface $command, Result $result) { + $action = $command->getName(); + if ($action == "SelectObjectContent") { + $result['Data'] = $this->getSelectContents($result); + } + return $result; + } + + public function ciContentInfoTransformer(CommandInterface $command, Result $result) { + $action = $command->getName(); + if ($action == "ImageInfo" || $action == "ImageExif" || $action == "ImageAve") { + $length = intval($result['ContentLength']); + if($length > 0){ + $result['Data'] = $this->geCiContentInfo($result, $length); + } + } + + if ($action == "PutObject" && isset($command["PicOperations"]) && $command["PicOperations"]) { + $picOperations = json_decode($command["PicOperations"], true); + $picRuleSize = isset($picOperations['rules']) && is_array($picOperations['rules']) ? sizeof($picOperations['rules']) : 0; + $length = intval($result['ContentLength']); + if($length > 0){ + $content = $this->geCiContentInfo($result, $length); + $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA); + $xmlData = json_decode(json_encode($obj),true); + if ($picRuleSize == 1 && isset($xmlData['ProcessResults']['Object'])){ + $tmp = $xmlData['ProcessResults']['Object']; + unset($xmlData['ProcessResults']['Object']); + $xmlData['ProcessResults']['Object'][] = $tmp; + } + $result['Data'] = $xmlData; + } + } + + if ($action == "GetBucketGuetzli" ) { + $length = intval($result['ContentLength']); + if($length > 0){ + $content = $this->geCiContentInfo($result, $length); + $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA); + $arr = json_decode(json_encode($obj),true); + $result['GuetzliStatus'] = isset($arr[0]) ? $arr[0] : ''; + } + } + + $xml2JsonActions = array( + 'CreateMediaTranscodeJobs' => 1, + 'CreateMediaJobs' => 1, + 'DescribeMediaJob' => 1, + 'DescribeMediaJobs' => 1, + 'CreateMediaSnapshotJobs' => 1, + 'CreateMediaConcatJobs' => 1, + 'CreateMediaVoiceSeparateJobs' => 1, + 'DescribeMediaVoiceSeparateJob' => 1, + ); + if (key_exists($action, $xml2JsonActions)) { + $length = intval($result['ContentLength']); + if($length > 0){ + $content = $this->geCiContentInfo($result, $length); + $obj = simplexml_load_string($content, "SimpleXMLElement", LIBXML_NOCDATA); + $xmlData = json_decode(json_encode($obj),true); + $result['Response'] = $xmlData; + } + } + + return $result; + } + + public function geCiContentInfo($result, $length) { + $f = $result['Body']; + $data = ""; + while (!$f->eof()) { + $tmp = $f->read($length); + if (empty($tmp)) { + break; + } + $data .= $tmp; + } + return $data; + } + + public function getSelectContents($result) { + $f = $result['RawData']; + while (!$f->eof()) { + $data = array(); + $tmp = $f->read(4); + if (empty($tmp)) { + break; + } + $total_length = (int)(unpack("N", $tmp)[1]); + $headers_length = (int)(unpack("N", $f->read(4))[1]); + $body_length = $total_length - $headers_length - 16; + $predule_crc = (int)(unpack("N", $f->read(4))[1]); + $headers = array(); + for ($offset = 0; $offset < $headers_length;) { + $key_length = (int)(unpack("C", $f->read(1))[1]); + $key = $f->read($key_length); + + $head_value_type = (int)(unpack("C", $f->read(1))[1]); + + $value_length = (int)(unpack("n", $f->read(2))[1]); + $value = $f->read($value_length); + $offset += 4 + $key_length + $value_length; + if ($key == ":message-type") { + $data['MessageType'] = $value; + } + if ($key == ":event-type") { + $data['EventType'] = $value; + } + if ($key == ":error-code") { + $data['ErrorCode'] = $value; + } + if ($key == ":error-message") { + $data['ErrorMessage'] = $value; + } + } + $body = $f->read($body_length); + $message_crc = (int)(unpack("N", $f->read(4))[1]); + $data['Body'] = $body; + yield $data; + } + } + public function __destruct() { + } + +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Serializer.php b/vendor/qcloud/cos-sdk-v5/src/Serializer.php new file mode 100644 index 0000000..1999e1b --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Serializer.php @@ -0,0 +1,81 @@ +offsetExists('key') === true) { + $mode = empty($command->offsetGet('auth')) === false + ? $command->offsetGet('auth') + : 'loco'; + if ($mode !== 'query') { + // else use Authorization header of various types + if ($mode === 'loco') { + $value = 'Loco '.$command->offsetGet('key'); + $request = $request->withHeader('Authorization', $value); + } elseif ($mode === 'basic') { + $value = 'Basic '.base64_encode($command->offsetGet('key').':'); + $request = $request->withHeader('Authorization', $value); + } else { + throw new \InvalidArgumentException("Invalid auth type: {$mode}"); + } + // avoid request sending key parameter in query string + $command->offsetUnset('key'); + } + } + // Remap legacy parameters to common `data` binding on request body + static $remap = [ + 'import' => ['src'=>'data'], + 'translate' => ['translation'=>'data'], + ]; + $name = $command->getName(); + if (isset($remap[$name])) { + foreach ($remap[$name] as $old => $new) { + if ($command->offsetExists($old)) { + $command->offsetSet($new, $command->offsetGet($old)); + $command->offsetUnset($old); + } + } + } + */ + return parent::prepareRequest($command, $request); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Service.php b/vendor/qcloud/cos-sdk-v5/src/Service.php new file mode 100644 index 0000000..ee9f6d3 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Service.php @@ -0,0 +1,7072 @@ + 'Cos Service', + 'apiVersion' => 'V5', + 'description' => 'Cos V5 API Service', + 'operations' => array( + // 舍弃一个分块上传且删除已上传的分片块 + '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' + ) + ) + ), + // 创建存储桶(Bucket) + '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' + ) + ) + ), + // 完成整个分块上传 + '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', + ), + 'PicOperations' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Pic-Operations', + ) + ) + ), + // 初始化分块上传 + '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' + ) + ), + '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, + ), + 'PicOperations' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Pic-Operations', + ) + ) + ), + // 复制对象 + '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') + ), + '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, + ) + ), + ), + // 删除存储桶 (Bucket) + 'DeleteBucket' => array( + 'httpMethod' => 'DELETE', + 'uri' => '/{Bucket}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri' + ) + ) + ), + // 删除跨域访问配置信息 + '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', + ), + ), + ), + // 删除存储桶标签信息 + 'DeleteBucketTagging' => array( + 'httpMethod' => 'DELETE', + 'uri' => '/{Bucket}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketTaggingOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + // 删除存储桶标清单任务 + 'DeleteBucketInventory' => array( + 'httpMethod' => 'Delete', + 'uri' => '/{Bucket}?inventory', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketInventoryOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Id' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'id', + ) + ), + ), + // 删除 COS 上单个对象 + '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 对象 + '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( + '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', + ) + ), + ), + // 删除存储桶(Bucket)的website + 'DeleteBucketWebsite' => array( + 'httpMethod' => 'DELETE', + 'uri' => '/{Bucket}?website', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketWebsiteOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + // 删除存储桶(Bucket)的生命周期配置 + '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', + ), + ), + ), + // 删除跨区域复制配置 + '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', + ), + ), + ), + // 配置对象标签 + 'PutObjectTagging' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}{/Key*}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutObjectTaggingOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Tagging', + ), + 'contentMd5' => true, + ), + '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' + ) + ), + 'TagSet' => array( + 'required' => true, + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'TagRule', + 'type' => 'object', + 'sentAs' => 'Tag', + 'properties' => array( + 'Key' => array( + 'required' => true, + 'type' => 'string', + ), + 'Value' => array( + 'required' => true, + 'type' => 'string', + ), + ), + ), + ), + ), + ), + // 获取对象标签信息 + 'GetObjectTagging' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetObjectTaggingOutput', + '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' + ) + ) + ), + ), + // 删除对象标签 + 'DeleteObjectTagging' => array( + 'httpMethod' => 'DELETE', + 'uri' => '/{Bucket}{/Key*}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteObjectTaggingOutput', + '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' + ) + ) + ) + ), + // 下载对象 + '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', + ), + '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', + ), + 'TrafficLimit' => array( + 'type' => 'integer', + 'location' => 'header', + 'sentAs' => 'x-cos-traffic-limit', + ) + ) + ), + // 获取 COS 对象的访问权限信息(Access Control List, ACL) + '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', + ) + ) + ), + // 获取存储桶(Bucket)的访问权限信息(Access Control List, ACL) + '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' + ) + ) + ), + // 查询存储桶(Bucket)跨域访问配置信息 + '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', + ) + ), + ), + // 查询存储桶(Bucket)Domain配置信息 + 'GetBucketDomain' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?domain', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketDomainOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ) + ), + ), + // 查询存储桶(Bucket)Accelerate配置信息 + 'GetBucketAccelerate' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?accelerate', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketAccelerateOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ) + ), + ), + // 查询存储桶(Bucket)Website配置信息 + 'GetBucketWebsite' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?website', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketWebsiteOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ) + ), + ), + // 查询存储桶(Bucket)的生命周期配置 + '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', + ) + ), + ), + // 获取存储桶(Bucket)版本控制信息 + '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', + ) + ), + ), + // 获取存储桶(Bucket)跨区域复制配置信息 + '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', + ) + ), + ), + // 获取存储桶(Bucket)所在的地域信息 + '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', + ), + ), + ), + // 获取存储桶(Bucket)Notification信息 + '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', + ) + ), + ), + // 获取存储桶(Bucket)日志信息 + 'GetBucketLogging' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?logging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketLoggingOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ) + ), + ), + // 获取存储桶(Bucket)清单信息 + 'GetBucketInventory' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?inventory', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketInventoryOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Id' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'id', + ) + ), + ), + // 获取存储桶(Bucket)标签信息 + 'GetBucketTagging' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketTaggingOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ) + ), + ), + // 分块上传 + '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( + 'any'), + 'location' => 'body' + ), + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri' + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length' + ), + 'ContentMD5' => array( + 'type' => array( + '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', + ), + 'TrafficLimit' => array( + 'type' => 'integer', + 'location' => 'header', + 'sentAs' => 'x-cos-traffic-limit', + ) + ) + ), + // 上传对象 + '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( + 'required' => true, + 'type' => array( + 'any' + ), + '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', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length' + ), + 'ContentMD5' => array( + 'type' => array( + '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' + ) + ), + '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-cos-kms-key-id', + ), + 'RequestPayer' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-request-payer', + ), + 'ACP' => array( + 'type' => 'object', + 'additionalProperties' => true, + ), + 'PicOperations' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Pic-Operations', + ), + 'TrafficLimit' => array( + 'type' => 'integer', + 'location' => 'header', + 'sentAs' => 'x-cos-traffic-limit', + ), + 'Tagging' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-tagging', + ), + ) + ), + // 追加对象 + 'AppendObject' => array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}{/Key*}?append', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'AppendObjectOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'AppendObjectRequest' + ) + ), + 'parameters' => array( + 'Position' => array( + 'type' => 'integer', + 'required' => true, + 'location' => 'query', + 'sentAs' => 'position' + ), + 'ACL' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-acl' + ), + 'Body' => array( + 'required' => true, + 'type' => array( + 'any' + ), + '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', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length' + ), + 'ContentMD5' => array( + 'type' => array( + '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' + ) + ), + '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-cos-kms-key-id', + ), + 'RequestPayer' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-request-payer', + ), + 'ACP' => array( + 'type' => 'object', + 'additionalProperties' => true, + ), + 'PicOperations' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Pic-Operations', + ), + 'TrafficLimit' => array( + 'type' => 'integer', + 'location' => 'header', + 'sentAs' => 'x-cos-traffic-limit', + ) + ) + ), + // 设置 COS 对象的访问权限信息(Access Control List, ACL) + '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, + ), + ) + ), + // 设置存储桶(Bucket)的访问权限(Access Control List, ACL) + '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)的跨域配置信息 + '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)的Domain信息 + 'PutBucketDomain' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?domain', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketDomainOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'DomainConfiguration', + ), + 'contentMd5' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'DomainRules' => array( + 'required' => true, + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'DomainRule', + 'type' => 'object', + 'sentAs' => 'DomainRule', + 'properties' => array( + 'Status' => array( + 'required' => true, + 'type' => 'string', + ), + 'Name' => array( + 'required' => true, + 'type' => 'string', + ), + 'Type' => array( + 'required' => true, + 'type' => 'string', + ), + 'ForcedReplacement' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + // 设置存储桶(Bucket)生命周期配置 + '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)版本控制 + '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)Accelerate + 'PutBucketAccelerate' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?accelerate', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketAccelerateOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'AccelerateConfiguration', + ), + 'xmlAllowEmpty' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Status' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ) + ), + ), + // 配置存储桶(Bucket)website + 'PutBucketWebsite' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?website', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketWebsiteOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'WebsiteConfiguration', + ), + 'xmlAllowEmpty' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'ErrorDocument' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + 'minLength' => 1, + ), + ), + ), + 'IndexDocument' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Suffix' => array( + 'required' => true, + 'type' => 'string', + ), + ), + ), + 'RedirectAllRequestsTo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HostName' => array( + 'type' => 'string', + ), + 'Protocol' => array( + 'type' => 'string', + ), + ), + ), + 'RoutingRules' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'RoutingRule', + 'type' => 'object', + 'properties' => array( + 'Condition' => array( + 'type' => 'object', + 'properties' => array( + 'HttpErrorCodeReturnedEquals' => array( + 'type' => 'string', + ), + 'KeyPrefixEquals' => array( + 'type' => 'string', + ), + ), + ), + 'Redirect' => array( + 'type' => 'object', + 'properties' => array( + 'HostName' => array( + 'type' => 'string', + ), + 'HttpRedirectCode' => array( + 'type' => 'string', + ), + 'Protocol' => array( + 'type' => 'string', + ), + 'ReplaceKeyPrefixWith' => array( + 'type' => 'string', + ), + 'ReplaceKeyWith' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + ), + ), + // 配置存储桶(Bucket)跨区域复制 + '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') + ), + ), + ), + ), + ), + ), + ), + // 配置存储桶(Bucket)标签 + 'PutBucketTagging' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?tagging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketTaggingOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Tagging', + ), + 'contentMd5' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'TagSet' => array( + 'required' => true, + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'TagRule', + 'type' => 'object', + 'sentAs' => 'Tag', + 'properties' => array( + 'Key' => array( + 'required' => true, + 'type' => 'string', + ), + 'Value' => array( + 'required' => true, + 'type' => 'string', + ), + ), + ), + ), + ), + ), + //开启存储桶(Bucket)日志服务 + 'PutBucketLogging' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?logging', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketLoggingOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'BucketLoggingStatus', + ), + 'contentMd5' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'LoggingEnabled' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'TargetBucket' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'TargetPrefix' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ) + ), + ), + ), + // 配置存储桶(Bucket)清单 + 'PutBucketInventory' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?inventory', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketInventoryOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'InventoryConfiguration', + ), + 'contentMd5' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Id' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'IsEnabled' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'Destination' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'COSBucketDestination'=> array( + 'type' => 'object', + 'properties' => array( + 'Format' => array( + 'type' => 'string', + 'require' => true, + ), + 'AccountId' => array( + 'type' => 'string', + 'require' => true, + ), + 'Bucket' => array( + 'type' => 'string', + 'require' => true, + ), + 'Prefix' => array( + 'type' => 'string', + ), + 'Encryption' => array( + 'type' => 'object', + 'properties' => array( + 'SSE-COS' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + ), + 'Schedule' => array( + 'required' => true, + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Frequency' => array( + 'type' => 'string', + 'require' => true, + ), + ) + ), + 'Filter' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Prefix' => array( + 'type' => 'string', + ), + ) + ), + 'IncludedObjectVersions' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'OptionalFields' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'Fields', + 'type' => 'string', + 'sentAs' => 'Field', + ), + ), + ), + ), + // 回热归档对象 + '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', + ), + ), + ), + // 查询存储桶(Bucket)中正在进行中的分块上传对象 + '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' + ) + ) + ), + // 查询存储桶(Bucket)下的部分或者全部对象 + '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' + ) + ) + ), + // 获取所属账户的所有存储空间列表 + 'ListBuckets' => array( + 'httpMethod' => 'GET', + 'uri' => '/', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ListBucketsOutput', + 'responseType' => 'model', + 'parameters' => array( + ), + ), + // 获取多版本对象 + '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', + ) + ), + ), + // 获取已上传分块列表 + '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', + ) + ), + ), + // 获取清单列表 + 'ListBucketInventoryConfigurations' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?inventory', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ListBucketInventoryConfigurationsOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri' + ), + 'ContinuationToken' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'continuation-token', + ), + ), + ), + // 获取对象的meta信息 + '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', + ), + ) + ), + // 存储桶(Bucket)是否存在 + 'HeadBucket' => array( + 'httpMethod' => 'HEAD', + 'uri' => '/{Bucket}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'HeadBucketOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ) + ), + // 分块copy + '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', + ) + ), + ), + // 检索对象内容 + 'SelectObjectContent' => array( + 'httpMethod' => 'Post', + 'uri' => '/{/Key*}?select&select-type=2', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'SelectObjectContentOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'SelectRequest', + ), + 'contentMd5' => true, + ), + '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') + ), + 'Expression' => array( + 'type' => 'string', + 'location' => 'xml' + ), + 'ExpressionType' => array( + 'type' => 'string', + 'location' => 'xml' + ), + 'InputSerialization' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'CompressionType' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'CSV' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'FileHeaderInfo' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'RecordDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'FieldDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'QuoteCharacter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'QuoteEscapeCharacter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Comments' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'AllowQuotedRecordDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ) + ), + 'JSON' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Type' => array( + 'type' => 'string', + 'location' => 'xml', + ) + ) + ), + ) + ), + 'OutputSerialization' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'CompressionType' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'CSV' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'QuoteFields' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'RecordDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'FieldDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'QuoteCharacter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'QuoteEscapeCharacter' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ) + ), + 'JSON' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'RecordDelimiter' => array( + 'type' => 'string', + 'location' => 'xml', + ) + ) + ), + ) + ), + 'RequestProgress' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Enabled' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ) + ), + ), + ), + // 存储桶(Bucket)开启智能分层 + 'PutBucketIntelligentTiering' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?intelligenttiering', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketIntelligentTieringOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'IntelligentTieringConfiguration', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Status' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Transition' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Days' => array( + 'type' => 'integer', + 'location' => 'xml', + ), + 'RequestFrequent' => array( + 'type' => 'integer', + 'location' => 'xml', + ), + ) + ), + ), + ), + // 查询存储桶(Bucket)智能分层 + 'GetBucketIntelligentTiering' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?intelligenttiering', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketIntelligentTieringOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //万象-获取图片基本信息 + 'ImageInfo' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?imageInfo', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ImageInfoOutput', + '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' + ) + ), + ) + ), + //万象-获取图片EXIF信息 + 'ImageExif' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?exif', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ImageExifOutput', + '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' + ) + ), + ) + ), + //万象-获取图片主色调信息 + 'ImageAve' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?imageAve', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ImageAveOutput', + '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' + ) + ), + ), + ), + //万象-云上数据处理 + 'ImageProcess' => array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}{/Key*}?image_process', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'ImageProcessOutput', + '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' + ) + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'PicOperations' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Pic-Operations', + ), + ), + ), + //万象-二维码下载时识别 + 'Qrcode' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?ci-process=QRcode', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'QrcodeOutput', + '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' + ) + ), + 'Cover' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'cover' + ), + ), + ), + //万象-二维码生成 + 'QrcodeGenerate' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?ci-process=qrcode-generate', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'QrcodeGenerateOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'QrcodeContent' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'qrcode-content' + ), + 'QrcodeMode' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'mode' + ), + 'QrcodeWidth' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'width' + ), + ), + ), + //万象-图片标签 + 'DetectLabel' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}?ci-process=detect-label', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectLabelOutput', + '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' + ) + ), + ), + ), + //万象-增加样式 + 'PutBucketImageStyle' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?style', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketImageStyleOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'AddStyle', + ), + ), + 'parameters' => array( + 'StyleName' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'StyleBody' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //万象-查询样式 + 'GetBucketImageStyle' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?style', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketImageStyleOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'GetStyle', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'StyleName' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + //万象-删除样式 + 'DeleteBucketImageStyle' => array( + 'httpMethod' => 'Delete', + 'uri' => '/{Bucket}?style', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketImageStyleOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'DeleteStyle', + ), + ), + 'parameters' => array( + 'StyleName' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //万象-开通Guetzli压缩 + 'PutBucketGuetzli' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?guetzli', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketGuetzliOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //万象-查询Guetzli状态 + 'GetBucketGuetzli' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?guetzli', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketGuetzliOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //万象-关闭Guetzli压缩 + 'DeleteBucketGuetzli' => array( + 'httpMethod' => 'Delete', + 'uri' => '/{Bucket}?guetzli', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DeleteBucketGuetzliOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + ), + ), + //图片审核 + 'GetObjectSensitiveContentRecognition' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetObjectSensitiveContentRecognitionOutput', + 'responseType' => 'model', + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'ci-process' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query' + ), + 'Key' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + 'minLength' => 1, + 'filters' => array( + 'Qcloud\\Cos\\Client::explodeKey' + ) + ), + 'DetectType' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'detect-type' + ), + 'DetectUrl' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'detect-url' + ), + 'Interval' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'interval' + ), + 'MaxFrames' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'max-frames' + ), + 'BizType' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'biz-type' + ) + ), + ), + // 文本审核 + 'DetectText' => array( + 'httpMethod' => 'POST', + 'uri' => '/{Bucket}text/auditing', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'DetectTextOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'Request', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Input' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Content' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Object' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Url' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'DataId' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + 'Conf' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'DetectType' => array( 'type' => 'string', 'location' => 'xml', ), + 'Callback' => array( 'type' => 'string', 'location' => 'xml', ), + 'BizType' => array( 'type' => 'string', 'location' => 'xml', ), + 'CallbackVersion' => array( 'type' => 'string', 'location' => 'xml', ), + ), + ), + ), + ), + //媒体截图 + 'GetSnapshot' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetSnapshotOutput', + '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' + ) + ), + 'Time' => array( + 'required' => true, + 'type' => 'numeric', + 'location' => 'query', + 'sentAs' => 'time' + ), + 'ci-process' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query' + ), + 'Width' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'width' + ), + 'Height' => array( + 'type' => 'integer', + 'location' => 'query', + 'sentAs' => 'height' + ), + 'Format' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'format' + ), + 'Rotate' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'rotate' + ), + 'Mode' => array( + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'mode' + ) + ), + ), + //添加防盗链 + 'PutBucketReferer' => array( + 'httpMethod' => 'PUT', + 'uri' => '/{Bucket}?referer', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'PutBucketRefererOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'RefererConfiguration', + ), + 'contentMd5' => true, + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri', + ), + 'Status' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'RefererType' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + 'EmptyReferConfiguration' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'xml', + ), + + 'DomainList' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Domains' => array( + 'type' => 'array', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Domain', + 'type' => 'string', + 'sentAs' => 'Domain', + ), + ) + ) + ), + ), + ), + //获取防盗链规则 + 'GetBucketReferer' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}?referer', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetBucketRefererOutput', + 'responseType' => 'model', + 'data' => array( + 'xmlRoot' => array( + 'name' => 'RefererConfiguration', + ), + ), + 'parameters' => array( + 'Bucket' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'uri' + ) + ) + ), + //获取媒体信息 + 'GetMediaInfo' => array( + 'httpMethod' => 'GET', + 'uri' => '/{Bucket}{/Key*}', + 'class' => 'Qcloud\\Cos\\Command', + 'responseClass' => 'GetMediaInfoOutput', + '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' + ) + ), + 'ci-process' => array( + 'required' => true, + 'type' => 'string', + 'location' => 'query' + ) + ), + ), + 'CreateMediaTranscodeJobs' => Descriptions::CreateMediaTranscodeJobs(), // 媒体转码 + 'CreateMediaJobs' => Descriptions::CreateMediaJobs(), // 媒体任务 + 'DescribeMediaJob' => Descriptions::DescribeMediaJob(), // 查询指定的媒体任务 + 'DescribeMediaJobs' => Descriptions::DescribeMediaJobs(), // 拉取拉取符合条件的媒体任务 + 'CreateMediaSnapshotJobs' => Descriptions::CreateMediaSnapshotJobs(), // 媒体截图 + 'CreateMediaConcatJobs' => Descriptions::CreateMediaConcatJobs(), // 媒体拼接 + 'DetectAudio' => Descriptions::DetectAudio(), // 音频审核 + 'GetDetectAudioResult' => Descriptions::GetDetectAudioResult(), // 主动获取音频审核结果 + 'GetDetectTextResult' => Descriptions::GetDetectTextResult(), // 主动获取文本文件审核结果 + 'DetectVideo' => Descriptions::DetectVideo(), // 视频审核 + 'GetDetectVideoResult' => Descriptions::GetDetectVideoResult(), // 主动获取视频审核结果 + 'DetectDocument' => Descriptions::DetectDocument(), // 文档审核 + 'GetDetectDocumentResult' => Descriptions::GetDetectDocumentResult(), // 主动获取文档审核结果 + 'CreateDocProcessJobs' => Descriptions::CreateDocProcessJobs(), // 提交文档转码任务 + 'DescribeDocProcessQueues' => Descriptions::DescribeDocProcessQueues(), // 查询文档转码队列 + 'DescribeDocProcessJob' => Descriptions::DescribeDocProcessJob(), // 查询文档转码任务 + 'GetDescribeDocProcessJobs' => Descriptions::GetDescribeDocProcessJobs(), // 拉取符合条件的文档转码任务 + 'DetectImage' => Descriptions::DetectImage(), // 图片审核 + 'DetectImages' => Descriptions::DetectImages(), // 图片审核-批量 + 'DetectVirus' => Descriptions::DetectVirus(), // 云查毒 + 'GetDetectVirusResult' => Descriptions::GetDetectVirusResult(), // 查询病毒检测任务结果 + 'GetDetectImageResult' => Descriptions::GetDetectImageResult(), // 主动获取图片审核结果 + 'CreateMediaVoiceSeparateJobs' => Descriptions::CreateMediaVoiceSeparateJobs(), // 提交人声分离任务 + 'DescribeMediaVoiceSeparateJob' => Descriptions::DescribeMediaVoiceSeparateJob(), // 查询指定的人声分离任务 + 'DetectWebpage' => Descriptions::DetectWebpage(), // 提交网页审核任务 + 'GetDetectWebpageResult' => Descriptions::GetDetectWebpageResult(), // 查询网页审核任务结果 + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ), + 'ImageInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Format' => array( + 'type' => 'string', + ), + 'Width' => array( + 'type' => 'string', + ), + 'Height' => array( + 'type' => 'string', + ), + 'Quality' => array( + 'type' => 'string', + ), + 'Ave' => array( + 'type' => 'string', + ), + 'Orientation' => array( + 'type' => 'string', + ), + ), + ), + 'ProcessResults' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + 'Location' => array( + 'type' => 'string', + ), + 'Format' => array( + 'type' => 'string', + ), + 'Width' => array( + 'type' => 'string', + ), + 'Height' => array( + 'type' => 'string', + ), + 'Size' => array( + 'type' => 'string', + ), + 'Quality' => array( + 'type' => 'string', + ), + 'ETag' => array( + 'type' => 'string', + ), + 'WatermarkStatus' => array( + 'type' => 'integer', + ), + ), + ), + ), + ), + ), + ), + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ), + ), + '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', + ), + ), + ), + 'DeleteBucketTaggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'DeleteBucketInventoryOutput' => 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', + 'sentAs' => 'Deleted', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + '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( + 'type' => 'object', + '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', + ), + ), + ), + 'DeleteBucketWebsiteOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutObjectTaggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetObjectTaggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'TagSet' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'sentAs' => 'Tag', + 'type' => 'object', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + 'Value' => array( + 'type' => 'string', + ), + ), + ), + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'DeleteObjectTaggingOutput' => 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' => 'GuzzleHttp\\Psr7\\Stream', + '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', + 'minimum'=> 0, + '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', + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ), + ), + '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( + 'type' => 'object', + 'properties' => array( + 'Grantee' => array( + 'type' => 'object', + 'properties' => array( + 'DisplayName' => array( + 'type' => 'string'), + 'ID' => 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( + 'type' => 'object', + 'properties' => array( + 'Grantee' => array( + 'type' => 'object', + 'properties' => array( + 'DisplayName' => array( + 'type' => 'string' + ), + 'ID' => 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( + 'type' => 'object', + 'properties' => array( + 'ID' => array( + 'type' => 'string'), + 'AllowedHeaders' => array( + 'type' => 'array', + 'sentAs' => 'AllowedHeader', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'string', + ) + ), + 'AllowedMethods' => array( + 'type' => 'array', + 'sentAs' => 'AllowedMethod', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'string', + ), + ), + 'AllowedOrigins' => array( + 'type' => 'array', + 'sentAs' => 'AllowedOrigin', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'string', + ), + ), + 'ExposeHeaders' => array( + 'type' => 'array', + 'sentAs' => 'ExposeHeader', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'string', + ), + ), + 'MaxAgeSeconds' => array( + 'type' => 'numeric', + ), + ), + ), + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketDomainOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'DomainRules' => array( + 'type' => 'array', + 'location' => 'xml', + 'sentAs' => 'DomainRule', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Status' => array( + 'type' => 'string' + ), + 'Name' => array( + 'type' => 'string' + ), + 'Type' => array( + 'type' => 'string' + ), + 'ForcedReplacement' => array( + 'type' => 'string' + ), + ), + ), + ), + 'DomainTxtVerification' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-domain-txt-verification', + ), + '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( + 'type' => 'object', + '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( + 'type' => 'object', + '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', + ), + ), + ), + ), + 'GetBucketAccelerateOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Status' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Type' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketWebsiteOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RedirectAllRequestsTo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HostName' => array( + 'type' => 'string', + ), + 'Protocol' => array( + 'type' => 'string', + ), + ), + ), + 'IndexDocument' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Suffix' => array( + 'type' => 'string', + ), + ), + ), + 'ErrorDocument' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + ), + ), + 'RoutingRules' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'RoutingRule', + 'type' => 'object', + 'sentAs' => 'RoutingRule', + 'properties' => array( + 'Condition' => array( + 'type' => 'object', + 'properties' => array( + 'HttpErrorCodeReturnedEquals' => array( + 'type' => 'string', + ), + 'KeyPrefixEquals' => array( + 'type' => 'string', + ), + ), + ), + 'Redirect' => array( + 'type' => 'object', + 'properties' => array( + 'HostName' => array( + 'type' => 'string', + ), + 'HttpRedirectCode' => array( + 'type' => 'string', + ), + 'Protocol' => array( + 'type' => 'string', + ), + 'ReplaceKeyPrefixWith' => array( + 'type' => 'string', + ), + 'ReplaceKeyWith' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketInventoryOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Destination' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'COSBucketDestination' => array( + 'type' => 'object', + 'properties' => array( + 'Format' => array( + 'type' => 'string', + ), + 'AccountId' => array( + 'type' => 'string', + ), + 'Bucket' => array( + 'type' => 'string', + ), + 'Prefix' => array( + 'type' => 'string', + ), + 'Encryption' => array( + 'type' => 'object', + 'properties' => array( + 'SSE-COS' => array( + 'type' => 'string', + ) + ) + ), + + ), + ), + ), + ), + 'Schedule' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Frequency' => array( + 'type' => 'string', + ), + ), + ), + 'OptionalFields' => array( + 'type' => 'array', + 'location' => 'xml', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + ), + ), + 'OptionalFields' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'Field', + 'type' => 'string', + 'sentAs' => 'Field', + ), + ), + 'IsEnabled' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Id' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'IncludedObjectVersions' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketTaggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'TagSet' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'sentAs' => 'Tag', + 'type' => 'object', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + 'Value' => array( + 'type' => 'string', + ), + ), + ), + ), + '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( + 'type' => 'object', + 'properties' => array( + 'Id' => array( + 'type' => 'string', + ), + 'CloudFunction' => array( + 'type' => 'string', + 'sentAs' => 'CloudFunction', + ), + 'Events' => array( + 'type' => 'array', + 'sentAs' => 'Event', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'string', + ), + ), + '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( + 'type' => 'object', + 'properties' => array( + 'Name' => array( + 'type' => 'string', + ), + 'Value' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketLoggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'LoggingEnabled' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'TargetBucket' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'TargetPrefix' => array( + 'type' => 'string', + ), + ), + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ), + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ), + ), + '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', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ), + ), + 'AppendObjectOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'ETag' => array( + 'type' => 'string', + 'location' => 'header', + ), + 'Position' => array( + 'type' => 'integer', + 'location' => 'header', + 'sentAs' => 'x-cos-next-append-position', + ), + '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', + ), + ), + ), + 'PutBucketDomainOutput' => 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', + ), + ), + ), + 'PutBucketWebsiteOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketAccelerateOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketLoggingOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketInventoryOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketTaggingOutput' => 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( + 'type' => 'object', + '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( + '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( + '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( + 'type' => 'object', + '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', + ), + 'Version' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'object', + '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( + 'type' => 'object', + '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( + '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( + 'type' => 'object', + '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( + 'type' => 'object', + 'properties' => array( + 'Prefix' => array( + 'type' => 'string', + ), + ), + ), + ), + 'EncodingType' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'ListBucketInventoryConfigurationsOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'InventoryConfiguration' => array( + 'type' => 'array', + 'location' => 'xml', + 'sentAs' => 'InventoryConfiguration', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Destination' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'COSBucketDestination' => array( + 'type' => 'object', + 'properties' => array( + 'Format' => array( + 'type' => 'string', + ), + 'AccountId' => array( + 'type' => 'string', + ), + 'Bucket' => array( + 'type' => 'string', + ), + 'Prefix' => array( + 'type' => 'string', + ), + 'Encryption' => array( + 'type' => 'object', + 'properties' => array( + 'SSE-COS' => array( + 'type' => 'string', + ) + ) + ), + + ), + ), + ), + ), + 'Schedule' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Frequency' => array( + 'type' => 'string', + ), + ), + ), + 'OptionalFields' => array( + 'type' => 'array', + 'location' => 'xml', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + ), + ), + 'OptionalFields' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'name' => 'Field', + 'type' => 'string', + 'sentAs' => 'Field', + ), + ), + 'IsEnabled' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Id' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'IncludedObjectVersions' => 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', + 'minimum'=> 0, + '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', + ), + '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', + ), + 'CRC' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-hash-crc64ecma', + ) + ) + ), + 'HeadBucketOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'SelectObjectContentOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RawData' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + ), + ), + 'GetBucketIntelligentTieringOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Status' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'Transition' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Days' => array( + 'type' => 'string', + ), + 'RequestFrequent' => array( + 'type' => 'string', + ), + ) + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketIntelligentTieringOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'ImageInfoOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ), + 'ImageExifOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ), + 'ImageAveOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + ), + ), + 'ImageProcessOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'OriginalInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + 'Location' => array( + 'type' => 'string', + ), + 'ETag' => array( + 'type' => 'string', + ), + 'ImageInfo' => array( + 'type' => 'object', + 'properties' => array( + 'Format' => array( + 'type' => 'string', + ), + 'Width' => array( + 'type' => 'string', + ), + 'Height' => array( + 'type' => 'string', + ), + 'Quality' => array( + 'type' => 'string', + ), + 'Ave' => array( + 'type' => 'string', + ), + 'Orientation' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + 'ProcessResults' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Object' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Key' => array( + 'type' => 'string', + ), + 'Location' => array( + 'type' => 'string', + ), + 'Format' => array( + 'type' => 'string', + ), + 'Width' => array( + 'type' => 'string', + ), + 'Height' => array( + 'type' => 'string', + ), + 'Size' => array( + 'type' => 'string', + ), + 'Quality' => array( + 'type' => 'string', + ), + 'ETag' => array( + 'type' => 'string', + ), + 'WatermarkStatus' => array( + 'type' => 'integer', + ), + ), + ), + ), + ), + ), + ), + ), + 'QrcodeOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'CodeStatus' => array( + 'type' => 'integer', + 'location' => 'xml', + ), + 'QRcodeInfo' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'CodeUrl' => array( + 'type' => 'string', + ), + 'Point' => array( + 'type' => 'array', + 'items' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + 'ResultImage' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + 'QrcodeGenerateOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ResultImage' => array( + 'type' => 'string', + 'location' => 'xml', + ), + ), + ), + 'DetectLabelOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'Labels' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Confidence' => array( + 'type' => 'integer', + ), + 'Name' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + 'PutBucketImageStyleOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketImageStyleOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'StyleRule' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'StyleName' => array( + 'type' => 'string', + ), + 'StyleBody' => array( + 'type' => 'string', + ), + ), + ), + ), + ), + ), + 'DeleteBucketImageStyleOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'PutBucketGuetzliOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetBucketGuetzliOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + 'location' => 'body', + ), + ), + ), + 'DeleteBucketGuetzliOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + ), + ), + 'GetObjectSensitiveContentRecognitionOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'PornInfo' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Code' => array( + 'type' => 'integer', + ), + 'Msg' => array( + 'type' => 'string', + ), + 'HitFlag' => array( + 'type' => 'integer', + ), + 'Score' => array( + 'type' => 'integer', + ), + 'Label' => array( + 'type' => 'string', + ) + ), + ), + ), + 'TerroristInfo' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Code' => array( + 'type' => 'integer', + ), + 'Msg' => array( + 'type' => 'string', + ), + 'HitFlag' => array( + 'type' => 'integer', + ), + 'Score' => array( + 'type' => 'integer', + ), + 'Label' => array( + 'type' => 'string', + ) + ), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Code' => array( + 'type' => 'integer', + ), + 'Msg' => array( + 'type' => 'string', + ), + 'HitFlag' => array( + 'type' => 'integer', + ), + 'Score' => array( + 'type' => 'integer', + ), + 'Label' => array( + 'type' => 'string', + ) + ), + ), + ), + 'AdsInfo' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Code' => array( + 'type' => 'integer', + ), + 'Msg' => array( + 'type' => 'string', + ), + 'HitFlag' => array( + 'type' => 'integer', + ), + 'Score' => array( + 'type' => 'integer', + ), + 'Label' => array( + 'type' => 'string', + ) + ), + ), + ), + ) + ), + 'DetectTextOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-ci-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'JobsDetail' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Code' => array( 'type' => 'string', 'location' => 'xml',), + 'DataId' => array( 'type' => 'string', 'location' => 'xml',), + 'Message' => array( 'type' => 'string', 'location' => 'xml',), + 'JobId' => array( 'type' => 'string', 'location' => 'xml',), + 'State' => array( 'type' => 'string', 'location' => 'xml',), + 'CreationTime' => array( 'type' => 'string', 'location' => 'xml',), + 'Content' => array( 'type' => 'string', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'Result' => array( 'type' => 'integer', 'location' => 'xml',), + 'SectionCount' => array( 'type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'IllegalInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'AbuseInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Count' => array( 'type' => 'integer', 'location' => 'xml',), + ), + ), + 'Section' => array( + 'type' => 'array', + 'location' => 'xml', + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'StartByte' => array( 'type' => 'integer', 'location' => 'xml',), + 'Label' => array( 'type' => 'string', 'location' => 'xml',), + 'Result' => array( 'type' => 'integer', 'location' => 'xml',), + 'PornInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + 'TerrorismInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + 'PoliticsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + 'AdsInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + 'IllegalInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + 'AbuseInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'HitFlag' => array( 'type' => 'integer', 'location' => 'xml',), + 'Score' => array( 'type' => 'integer', 'location' => 'xml',), + 'Keywords' => array( 'type' => 'string', 'location' => 'xml',), + ), + ), + ), + ), + ), + ), + ), + ), + ), + 'GetSnapshotOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'Body' => array( + 'type' => 'string', + 'instanceOf' => 'GuzzleHttp\\Psr7\\Stream', + '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', + 'minimum'=> 0, + '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', + ), + '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', + ) + ) + ), + 'PutBucketRefererOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'ETag' => array( + 'type' => 'string', + 'location' => 'header', + ), + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ) + ) + ), + 'GetBucketRefererOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'location' => 'header', + 'sentAs' => 'x-cos-request-id' + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'Status' => array( + 'type' => 'string', + 'location' => 'xml' + ), + 'RefererType' => array( + 'type' => 'string', + 'location' => 'xml' + ), + 'EmptyReferConfiguration' => array( + 'type' => 'string', + 'location' => 'xml' + ), + 'DomainList' => array( + 'location' => 'xml', + 'type' => 'object', + 'properties' => array( + 'Domains' => array( + 'type' => 'array', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'name' => 'Domain', + 'type' => 'string', + 'sentAs' => 'Domain', + ), + ) + ) + ) + ) + ), + 'GetMediaInfoOutput' => array( + 'type' => 'object', + 'additionalProperties' => true, + 'properties' => array( + 'RequestId' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-cos-request-id', + ), + 'ContentType' => array( + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'Content-Type', + ), + 'ContentLength' => array( + 'type' => 'numeric', + 'minimum'=> 0, + 'location' => 'header', + 'sentAs' => 'Content-Length', + ), + 'MediaInfo' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Stream' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'JobId' => array( + 'type' => 'string', + ), + 'State' => array( + 'type' => 'string', + ), + 'Video' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Index' => array( + 'type' => 'integer', + ), + 'CodecName' => array( + 'type' => 'string', + ), + 'CodecLongName' => array( + 'type' => 'string', + ), + 'CodecTimeBase' => array( + 'type' => 'string', + ), + 'CodecTag' => array( + 'type' => 'string', + ), + 'Profile' => array( + 'type' => 'string', + ), + 'Height' => array( + 'type' => 'integer', + ), + 'Width' => array( + 'type' => 'integer', + ), + 'HasBFrame' => array( + 'type' => 'integer', + ), + 'RefFrames' => array( + 'type' => 'integer', + ), + 'Sar' => array( + 'type' => 'string', + ), + 'Dar' => array( + 'type' => 'string', + ), + 'PixFormat' => array( + 'type' => 'string', + ), + 'FieldOrder' => array( + 'type' => 'string', + ), + 'Level' => array( + 'type' => 'integer', + ), + 'Fps' => array( + 'type' => 'integer', + ), + 'AvgFps' => array( + 'type' => 'string', + ), + 'Timebase' => array( + 'type' => 'string', + ), + 'StartTime' => array( + 'type' => 'numeric', + ), + 'Duration' => array( + 'type' => 'numeric', + ), + 'Bitrate' => array( + 'type' => 'numeric', + ), + 'NumFrames' => array( + 'type' => 'integer', + ), + 'Language' => array( + 'type' => 'string', + ) + ), + 'Audio' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Index' => array( + 'type' => 'integer', + ), + 'CodecName' => array( + 'type' => 'string', + ), + 'CodecLongName' => array( + 'type' => 'string', + ), + 'CodecTimeBase' => array( + 'type' => 'string', + ), + 'CodecTagString' => array( + 'type' => 'string', + ), + 'CodecTag' => array( + 'type' => 'string', + ), + 'SampleFmt' => array( + 'type' => 'string', + ), + 'SampleRate' => array( + 'type' => 'integer', + ), + 'Channel' => array( + 'type' => 'integer', + ), + 'ChannelLayout' => array( + 'type' => 'string', + ), + 'Timebase' => array( + 'type' => 'string', + ), + 'StartTime' => array( + 'type' => 'numeric', + ), + 'Duration' => array( + 'type' => 'numeric', + ), + 'Bitrate' => array( + 'type' => 'numeric', + ), + 'Language' => array( + 'type' => 'string', + ) + ) + ), + 'Subtitle' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'Index' => array( + 'type' => 'integer', + ), + 'Language' => array( + 'type' => 'string', + ) + ) + ) + ), + ) + ), + 'Format' => array( + 'type' => 'object', + 'location' => 'xml', + 'properties' => array( + 'NumStream' => array( + 'type' => 'integer', + ), + 'NumProgram' => array( + 'type' => 'integer', + ), + 'FormatName' => array( + 'type' => 'string', + ), + 'FormatLongName' => array( + 'type' => 'string', + ), + 'StartTime' => array( + 'type' => 'numeric', + ), + 'Duration' => array( + 'type' => 'numeric', + ), + 'Bitrate' => array( + 'type' => 'integer', + ), + 'Size' => array( + 'type' => 'integer', + ) + ) + ) + ) + ) + + + ) + ), + 'CreateMediaTranscodeJobsOutput' => Descriptions::CreateMediaTranscodeJobsOutput(), + 'DescribeMediaJobOutput' => Descriptions::DescribeMediaJobOutput(), + 'DescribeMediaJobsOutput' => Descriptions::DescribeMediaJobsOutput(), + 'CreateMediaJobsOutput' => Descriptions::CreateMediaJobsOutput(), + 'CreateMediaSnapshotJobsOutput' => Descriptions::CreateMediaSnapshotJobsOutput(), + 'CreateMediaConcatJobsOutput' => Descriptions::CreateMediaConcatJobsOutput(), + 'DetectAudioOutput' => Descriptions::DetectAudioOutput(), + 'GetDetectAudioResultOutput' => Descriptions::GetDetectAudioResultOutput(), + 'GetDetectTextResultOutput' => Descriptions::GetDetectTextResultOutput(), + 'DetectVideoOutput' => Descriptions::DetectVideoOutput(), + 'GetDetectVideoResultOutput' => Descriptions::GetDetectVideoResultOutput(), + 'DetectDocumentOutput' => Descriptions::DetectDocumentOutput(), + 'GetDetectDocumentResultOutput' => Descriptions::GetDetectDocumentResultOutput(), + 'CreateDocProcessJobsOutput' => Descriptions::CreateDocProcessJobsOutput(), + 'DescribeDocProcessQueuesOutput' => Descriptions::DescribeDocProcessQueuesOutput(), + 'DescribeDocProcessJobOutput' => Descriptions::DescribeDocProcessJobOutput(), + 'GetDescribeDocProcessJobsOutput' => Descriptions::GetDescribeDocProcessJobsOutput(), + 'DetectImageOutput' => Descriptions::DetectImageOutput(), + 'DetectImagesOutput' => Descriptions::DetectImagesOutput(), + 'DetectVirusOutput' => Descriptions::DetectVirusOutput(), + 'GetDetectVirusResultOutput' => Descriptions::GetDetectVirusResultOutput(), + 'GetDetectImageResultOutput' => Descriptions::GetDetectImageResultOutput(), + 'CreateMediaVoiceSeparateJobsOutput' => Descriptions::CreateMediaVoiceSeparateJobsOutput(), + 'DescribeMediaVoiceSeparateJobOutput' => Descriptions::DescribeMediaVoiceSeparateJobOutput(), + 'DetectWebpageOutput' => Descriptions::DetectWebpageOutput(), + 'GetDetectWebpageResultOutput' => Descriptions::GetDetectWebpageResultOutput(), + ) + ); + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/Signature.php b/vendor/qcloud/cos-sdk-v5/src/Signature.php new file mode 100644 index 0000000..bb07304 --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/Signature.php @@ -0,0 +1,131 @@ +accessKey = $accessKey; + $this->secretKey = $secretKey; + $this->signHost = $signHost; + $this->token = $token; + $this->signHeader = [ + 'cache-control', + 'content-disposition', + 'content-encoding', + 'content-length', + 'content-md5', + 'content-type', + 'expect', + 'expires', + 'host', + 'if-match', + 'if-modified-since', + 'if-none-match', + 'if-unmodified-since', + 'origin', + 'range', + 'response-cache-control', + 'response-content-disposition', + 'response-content-encoding', + 'response-content-language', + 'response-content-type', + 'response-expires', + 'transfer-encoding', + 'versionid', + ]; + date_default_timezone_set( 'PRC' ); + } + + public function __destruct() { + } + + public function needCheckHeader( $header ) { + if ( startWith( $header, 'x-cos-' ) ) { + return true; + } + if ( in_array( $header, $this->signHeader ) ) { + return true; + } + return false; + } + + public function signRequest( RequestInterface $request ) { + $authorization = $this->createAuthorization( $request ); + return $request->withHeader( 'Authorization', $authorization ); + } + + public function createAuthorization( RequestInterface $request, $expires = '+30 minutes' ) { + if ( is_null( $expires ) || !strtotime( $expires )) { + $expires = '+30 minutes'; + } + $signTime = ( string )( time() - 60 ) . ';' . ( string )( strtotime( $expires ) ); + $urlParamListArray = []; + foreach ( explode( '&', $request->getUri()->getQuery() ) as $query ) { + if (!empty($query)) { + $tmpquery = explode( '=', $query ); + //为了保证CI的key中有=号的情况也能正常通过,ci在这层之前已经encode了,这里需要拆开重新encode,防止上方explode拆错 + $key = strtolower( rawurlencode(urldecode($tmpquery[0])) ); + if (count($tmpquery) >= 2) { + $value = $tmpquery[1]; + } else { + $value = ""; + } + //host开关 + if (!$this->signHost && $key == 'host') { + continue; + } + $urlParamListArray[$key] = $key. '='. $value; + } + } + ksort($urlParamListArray); + $urlParamList = join(';', array_keys($urlParamListArray)); + $httpParameters = join('&', array_values($urlParamListArray)); + + $headerListArray = []; + foreach ( $request->getHeaders() as $key => $value ) { + $key = strtolower( urlencode( $key ) ); + $value = rawurlencode( $value[0] ); + if ( !$this->signHost && $key == 'host' ) { + continue; + } + if ( $this->needCheckHeader( $key ) ) { + $headerListArray[$key] = $key. '='. $value; + } + } + ksort($headerListArray); + $headerList = join(';', array_keys($headerListArray)); + $httpHeaders = join('&', array_values($headerListArray)); + $httpString = strtolower( $request->getMethod() ) . "\n" . urldecode( $request->getUri()->getPath() ) . "\n" . $httpParameters. + "\n". $httpHeaders. "\n"; + $sha1edHttpString = sha1( $httpString ); + $stringToSign = "sha1\n$signTime\n$sha1edHttpString\n"; + $signKey = hash_hmac( 'sha1', $signTime, trim($this->secretKey) ); + $signature = hash_hmac( 'sha1', $stringToSign, $signKey ); + $authorization = 'q-sign-algorithm=sha1&q-ak='. trim($this->accessKey) . + "&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=$headerList&q-url-param-list=$urlParamList&" . + "q-signature=$signature"; + return $authorization; + } + + public function createPresignedUrl( RequestInterface $request, $expires = '+30 minutes' ) { + $authorization = $this->createAuthorization( $request, $expires); + $uri = $request->getUri(); + $query = 'sign='.urlencode( $authorization ) . '&' . $uri->getQuery(); + if ( $this->token != null ) { + $query = $query.'&x-cos-security-token='.$this->token; + } + $uri = $uri->withQuery( $query ); + return $uri; + } +} diff --git a/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php b/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php new file mode 100644 index 0000000..358a87e --- /dev/null +++ b/vendor/qcloud/cos-sdk-v5/src/SignatureMiddleware.php @@ -0,0 +1,23 @@ +nextHandler = $nextHandler; + $this->signature = new Signature($accessKey, $secretKey, $signHost); + } + + public function __invoke(RequestInterface $request, array $options) { + $fn = $this->nextHandler; + return $fn($this->signature->signRequest($request), $options); + } +} diff --git a/vendor/qiniu/php-sdk/.github/workflows/test-ci.yml b/vendor/qiniu/php-sdk/.github/workflows/test-ci.yml new file mode 100644 index 0000000..a3f76f1 --- /dev/null +++ b/vendor/qiniu/php-sdk/.github/workflows/test-ci.yml @@ -0,0 +1,44 @@ +name: PHP CI with Composer + +on: + push: + paths-ignore: + - '**.md' + +jobs: + build: + strategy: + fail-fast: false + max-parallel: 1 + matrix: + php-versions: ['5.4', '5.5', '5.6', '7.0'] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Install dependencies + run: | + composer self-update + composer install --no-interaction --prefer-source --dev + + - name: Run cases + run: | + ./vendor/bin/phpcs --standard=PSR2 src + ./vendor/bin/phpcs --standard=PSR2 examples + ./vendor/bin/phpcs --standard=PSR2 tests + ./vendor/bin/phpunit --coverage-clover=coverage.xml + + env: + QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }} + QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }} + QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }} + QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }} + + - name: After_success + run: bash <(curl -s https://codecov.io/bash) diff --git a/vendor/qiniu/php-sdk/.gitignore b/vendor/qiniu/php-sdk/.gitignore new file mode 100644 index 0000000..4c842c8 --- /dev/null +++ b/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/ diff --git a/vendor/qiniu/php-sdk/.scrutinizer.yml b/vendor/qiniu/php-sdk/.scrutinizer.yml new file mode 100644 index 0000000..6a2d0d8 --- /dev/null +++ b/vendor/qiniu/php-sdk/.scrutinizer.yml @@ -0,0 +1,42 @@ +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] +build: + nodes: + analysis: + tests: + override: + - php-scrutinizer-run + diff --git a/vendor/qiniu/php-sdk/CHANGELOG.md b/vendor/qiniu/php-sdk/CHANGELOG.md new file mode 100644 index 0000000..200b76a --- /dev/null +++ b/vendor/qiniu/php-sdk/CHANGELOG.md @@ -0,0 +1,147 @@ +# Changelog + +## 7.5.0 (2022-04-18) +* 对象存储,新增支持 [深度归档存储类型](https://developer.qiniu.com/kodo/3956/kodo-category#deep_archive) + +## 7.4.3 (2022-04-01) +* 优化签名算法逻辑 + +## 7.4.2(2022-03-01) +* 修复已知关于请求 Header 处理不当问题,比如没有处理为大小写不敏感等问题 + +## 7.4.1(2021-09-24) +* 修复了 分片上传 v2 已知问题,明确给出了参数不合理情况下对应的错误提示信息 + +## 7.4.0 (2021-07-19) +* 【对象存储】支持 [分片上传 v2](https://developer.qiniu.com/kodo/7458/multipartupload) 和 断点续传,使用方式见 [开发者文档](https://developer.qiniu.com/kodo/1241/php#resume-upload-file) + +## 7.3.0 (2020-09-24) +### 新增 +* 【对象存储】增加异步抓取方法与demo +* 【融合cdn】增加查询CDN刷新记录、查询CDN预取记录方法与demo +* 【云短信】增加查询短信发送记录的方法 +* 【实时音视频】增加rtc停止房间的合流转推方法 +* 【内容审核】增加图片审核、视频审核方法与demo + +### 修复 +* 【对象存储】修复签算 token 时上传策略中的 forceSaveKey 字段不生效的问题 +* 【对象存储】修复更新空间事件通知规则方法 + +### 优化 +* 【对象存储】创建空间迁移到mkbucketv3 api +* 优化对 http2 返回头的判断 +* 优化 demo 中的文档注释说明 +* docs 目录下的 rtc demo 移动至 examples/rtc 目录下 +* docs 目录下的 sms demo 移动至 examples/sms 目录下 + +## 7.2.10 (2019-10-28) +* 去除云短信类类型指定 +* 修改不传文件名时存在表单上传错误的情况 + +## 7.2.9 (2019-07-09) +* 添加空间管理、云短信接口 +* 去除无效参数 + +## 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 diff --git a/vendor/qiniu/php-sdk/CONTRIBUTING.md b/vendor/qiniu/php-sdk/CONTRIBUTING.md new file mode 100644 index 0000000..0466bf9 --- /dev/null +++ b/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/ + +``` diff --git a/vendor/qiniu/php-sdk/LICENSE b/vendor/qiniu/php-sdk/LICENSE new file mode 100644 index 0000000..ba646be --- /dev/null +++ b/vendor/qiniu/php-sdk/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Qiniu, Ltd. + +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. + diff --git a/vendor/qiniu/php-sdk/README.md b/vendor/qiniu/php-sdk/README.md new file mode 100644 index 0000000..447a07d --- /dev/null +++ b/vendor/qiniu/php-sdk/README.md @@ -0,0 +1,76 @@ +# Qiniu Cloud SDK for PHP +[![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) +[![GitHub release](https://img.shields.io/github/v/tag/qiniu/php-sdk.svg?label=release)](https://github.com/qiniu/php-sdk/releases) +[![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) +[![Coverage Status](https://codecov.io/gh/qiniu/php-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/qiniu/php-sdk) +[![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; +... + $uploadMgr = new UploadManager(); + $auth = new Auth($accessKey, $secretKey); + $token = $auth->uploadToken($bucket); + list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath'); +... +``` + +## 测试 + +``` bash +$ ./vendor/bin/phpunit tests/Qiniu/Tests/ +``` + +## 常见问题 + +- `$error` 保留了请求响应的信息,失败情况下 `ret` 为 `none`, 将 `$error` 可以打印出来,提交给我们。 +- API 的使用 demo 可以参考 [examples](https://github.com/qiniu/php-sdk/tree/master/examples)。 + +## 代码贡献 + +详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)。 + +## 贡献记录 + +- [所有贡献者](https://github.com/qiniu/php-sdk/contributors) + +## 联系我们 + +- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件) +- 如果有什么问题,可以到问答社区提问,[问答社区](https://qiniu.segmentfault.com/) +- 更详细的文档,见[官方文档站](https://developer.qiniu.com/) +- 如果发现了 bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues) +- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues) +- 如果要提交代码,欢迎提交 pull request +- 欢迎关注我们的[微信](https://www.qiniu.com/#weixin) [微博](https://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 diff --git a/vendor/qiniu/php-sdk/autoload.php b/vendor/qiniu/php-sdk/autoload.php new file mode 100644 index 0000000..b553d1c --- /dev/null +++ b/vendor/qiniu/php-sdk/autoload.php @@ -0,0 +1,18 @@ +=5.3.3", + "myclabs/php-enum": "1.6.6" + }, + "require-dev": { + "paragonie/random_compat": ">=2", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~3.6" + }, + "autoload": { + "psr-4": { + "Qiniu\\": "src/Qiniu" + }, + "files": [ + "src/Qiniu/functions.php" + ] + } +} diff --git a/vendor/qiniu/php-sdk/examples/README.md b/vendor/qiniu/php-sdk/examples/README.md new file mode 100644 index 0000000..b7b4f98 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/README.md @@ -0,0 +1,10 @@ +# examples + +这些 examples 旨在帮助你快速了解使用七牛的 SDK。这些 demo 都是可以直接运行的, 但是在运行之前需要填上您自己的参数。 + +比如: + +* `$bucket` 需要填上您想操作的 [bucket名字](https://portal.qiniu.com/kodo/bucket)。 +* `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/user/key)找到。 +* 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/dora/media-gate/pipeline)新建。 + diff --git a/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php b/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php new file mode 100644 index 0000000..9dc0f84 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/bucket_lifecycleRule.php @@ -0,0 +1,40 @@ +bucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days, + $to_line_after_days, + $to_archive_after_days, + $to_deep_archive_after_days +); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php b/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php new file mode 100644 index 0000000..c9de0e6 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_bandwidth.php @@ -0,0 +1,41 @@ +getBandwidthData( + $domains, + $startDate, + $endDate, + $granularity +); + +if ($getBandwidthErr != null) { + var_dump($getBandwidthErr); +} else { + echo "get bandwidth data success\n"; + print_r($bandwidthData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_flux.php b/vendor/qiniu/php-sdk/examples/cdn_get_flux.php new file mode 100644 index 0000000..57df808 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_flux.php @@ -0,0 +1,35 @@ +getFluxData($domains, $startDate, $endDate, $granularity); +if ($getFluxErr != null) { + var_dump($getFluxErr); +} else { + echo "get flux data success\n"; + print_r($fluxData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php new file mode 100644 index 0000000..2b3f7dd --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_log_list.php @@ -0,0 +1,31 @@ +getCdnLogList($domains, $logDate); +if ($getLogErr != null) { + var_dump($getLogErr); +} else { + echo "get cdn log list success\n"; + print_r($logListData); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php new file mode 100644 index 0000000..958e5eb --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_prefetch_list.php @@ -0,0 +1,46 @@ +getCdnPrefetchList( + $requestId, + $urls, + $state, + $pageNo, + $pageSize, + $startTime, + $endTime +); +echo "\n====> query prefetch list: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php b/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php new file mode 100644 index 0000000..ad4fca2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_get_refresh_list.php @@ -0,0 +1,48 @@ +getCdnRefreshList( + $requestId, + $isDir, + $urls, + $state, + $pageNo, + $pageSize, + $startTime, + $endTime +); +echo "\n====> query refresh list: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php b/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php new file mode 100644 index 0000000..2140378 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_refresh_urls_dirs.php @@ -0,0 +1,59 @@ +refreshUrlsAndDirs($urls, $dirs); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh request sent\n"; + print_r($refreshResult); +} + +//---------------------------------------- demo2 ---------------------------------------- +// 刷新文件 + +list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh urls request sent\n"; + print_r($refreshResult); +} + +//---------------------------------------- demo3 ---------------------------------------- +// 刷新目录 + +list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs); +if ($refreshErr != null) { + var_dump($refreshErr); +} else { + echo "refresh dirs request sent\n"; + print_r($refreshResult); +} diff --git a/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php b/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php new file mode 100644 index 0000000..f2d7855 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/cdn_timestamp_antileech.php @@ -0,0 +1,20 @@ +censorImage($body); +echo "\n====> Result is: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/censor_video.php b/vendor/qiniu/php-sdk/examples/censor_video.php new file mode 100644 index 0000000..7ac056f --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/censor_video.php @@ -0,0 +1,52 @@ +censorVideo($body); +echo "\n====> Result is: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "job_id is: $jobid\n"; +} + +// 查询视频审核结果 +list($ret, $err) = $argusManager->censorStatus($jobid); +echo "\n====> job status: \n"; + +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucket.php b/vendor/qiniu/php-sdk/examples/delete_bucket.php new file mode 100644 index 0000000..325a47a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucket.php @@ -0,0 +1,27 @@ +deleteBucket($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php b/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php new file mode 100644 index 0000000..7eb744d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucketEvent.php @@ -0,0 +1,28 @@ +deleteBucketEvent($bucket, $name); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php b/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php new file mode 100644 index 0000000..2146b1b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/delete_bucketLifecycleRule.php @@ -0,0 +1,27 @@ +deleteBucketLifecycleRule($bucket, $name); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketEvents.php b/vendor/qiniu/php-sdk/examples/get_bucketEvents.php new file mode 100644 index 0000000..2379584 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketEvents.php @@ -0,0 +1,26 @@ +getBucketEvents($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php b/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php new file mode 100644 index 0000000..a35feed --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketLifecycleRules.php @@ -0,0 +1,26 @@ +getBucketLifecycleRules($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketList.php b/vendor/qiniu/php-sdk/examples/get_bucketList.php new file mode 100644 index 0000000..6a2f7b0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketList.php @@ -0,0 +1,26 @@ +listbuckets($region); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketQuota.php b/vendor/qiniu/php-sdk/examples/get_bucketQuota.php new file mode 100644 index 0000000..93474b5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketQuota.php @@ -0,0 +1,26 @@ +getBucketQuota($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketinfo.php b/vendor/qiniu/php-sdk/examples/get_bucketinfo.php new file mode 100644 index 0000000..98fd9f7 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketinfo.php @@ -0,0 +1,25 @@ +bucketInfo($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_bucketinfos.php b/vendor/qiniu/php-sdk/examples/get_bucketinfos.php new file mode 100644 index 0000000..5eec1d8 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_bucketinfos.php @@ -0,0 +1,26 @@ +bucketInfos($region); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/get_corsRules.php b/vendor/qiniu/php-sdk/examples/get_corsRules.php new file mode 100644 index 0000000..58e28be --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/get_corsRules.php @@ -0,0 +1,26 @@ +getCorsRules($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/image_url_builder.php b/vendor/qiniu/php-sdk/examples/image_url_builder.php new file mode 100644 index 0000000..20e2b00 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/image_url_builder.php @@ -0,0 +1,74 @@ + + */ +$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 int $dissolve 透明度 [可选] + * @param string $gravity 水印位置 [可选] + * @param int $dx 横轴边距 [可选] + * @param int $dy 纵轴边距 [可选] + * @param int $watermarkScale 自适应原图的短边比例 [可选] + * @link https://developer.qiniu.com/dora/api/1316/image-watermarking-processing-watermark + * @return string + * @author Sherlock Ren + */ +$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 int $dissolve 透明度 [可选] + * @param string $gravity 水印位置 [可选] + * @param int $dx 横轴边距 [可选] + * @param int $dy 纵轴边距 [可选] + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark + * @return string + * @author Sherlock Ren + */ +$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300); +// 函数调用方法 +// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300); +var_dump($textLink); diff --git a/vendor/qiniu/php-sdk/examples/persistent_fop_init.php b/vendor/qiniu/php-sdk/examples/persistent_fop_init.php new file mode 100644 index 0000000..baca846 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/persistent_fop_init.php @@ -0,0 +1,18 @@ +useHTTPS=true; + +// 初始化 +$pfop = new PersistentFop($auth, $config); diff --git a/vendor/qiniu/php-sdk/examples/persistent_fop_status.php b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php new file mode 100644 index 0000000..73e85a3 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php @@ -0,0 +1,19 @@ +status($persistentId); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_mkzip.php b/vendor/qiniu/php-sdk/examples/pfop_mkzip.php new file mode 100644 index 0000000..fb95cc2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_mkzip.php @@ -0,0 +1,58 @@ +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"; +} + +// 查询转码的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop mkzip status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_vframe.php b/vendor/qiniu/php-sdk/examples/pfop_vframe.php new file mode 100644 index 0000000..49fd36d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_vframe.php @@ -0,0 +1,55 @@ +useHTTPS = true; +$pfop = new PersistentFop($auth, $config); + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_480x360.jpg'; + +// 进行视频截帧操作 +$fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" . + \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +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); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php b/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php new file mode 100644 index 0000000..986aa8c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_video_avthumb.php @@ -0,0 +1,55 @@ +useHTTPS=true; + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_640x360.mp4'; + +$pfop = new PersistentFop($auth, $config); + +// 进行视频转码操作 +$fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +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); +} diff --git a/vendor/qiniu/php-sdk/examples/pfop_watermark.php b/vendor/qiniu/php-sdk/examples/pfop_watermark.php new file mode 100644 index 0000000..ea3d6bc --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pfop_watermark.php @@ -0,0 +1,59 @@ +useHTTPS=true; +$pfop = new PersistentFop($auth, $config); + +// 图片水印的源路径,也就是给视频打图片水印的图片 +$base64URL = Qiniu\base64_urlSafeEncode('http://test-2.qiniudn.com/logo.png'); + +// 视频处理完毕后保存到空间中的名称 +$saveasKey = 'qiniu_watermark.mp4'; + +// 进行视频打图片水印操作 +$fops = "avthumb/mp4/wmImage/" . $base64URL . "|saveas/" + . \Qiniu\base64_urlSafeEncode("$bucket:$saveasKey"); + +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); +} diff --git a/vendor/qiniu/php-sdk/examples/php-logo.png b/vendor/qiniu/php-sdk/examples/php-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..77e051fe413b2754bc121876b5f986d028a8449a GIT binary patch literal 65062 zcmdqIWmBC^&@GHR1b265Z`|G8CAhmgA-K!N-Q6KrumpG5IKkcBg4@Y`>UqxlAKnjF zO-*-SQ!`aPt9#b;M5`*xpdt|>K|nyD%E?NqLqI^5{`&+F;QmRH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5@+WcM4WzQ(wT|wJ;5qM+EUC|*c9>AqRE|rl#N3jkGflF&(O`}E=CqM!; zj(YxP<84O=G&+eSN@}?+47%oKVex1)l$F0UFPgMzAfXhN8Hn++C&0S&#j*vg0uATH zK$+R5fzQG*PFMesBatOME9MbyYvVx0-LdsIwPQ?`QRYn8mS%z$#6m1#>%ngmkD`(fOqlJTU9R;InY&u^0lBVXZ`2($4y!38A_eDnP5VebW| zsv1imBeNF~|4oAUxc-9AQ@txm9X4N4bp$|ub1r{h%I^X7w`BToBgq6OcHC*DfyKFW`A#bGLGv+~DH@fiSVa&BgqJw@jfQSJ z3hhfpp&|b8pDaYK4LadcRzGttT3ZePV_;rDPG`g;2roKBSRxS$4W;Ayii+CPH(-si zwSbOii$mv*3AlvlJ@mC9M4yup$bme=uZI;VA(bp<;BE7B$jaOqS9+ zlFka2%}4-Ar*U++Iaiyt+e#p-Qv2losD1Kt{`J7A%5770RLU(1zo zG;ZPkc07kY(zD*s)6oItK$V=P6DaZ?0zneQtKKlezMvJd4_5sR%zFP=fIw8a_wW=x zeknv?96ug)s&E*AbmuMUhDc8KeOW>qpCV8#O*ys52fX`QjvuWM|0trUFtK+3;-NuB zm6J_`5(ydxr}Mru8b8f{a5dR`K0sLcQkZ`9M=^SYZ-W~ZH4;%?miye`w+oC$#cnV! zRID?&_%1j@`FMM%tqOq1beyDwN)r{em4K`_&jM7#Z7rls4E>)WrFA0U{bz|#y8koa z`!~HC=zT^0vrszVe}*dez6t)f5B@idjt=#ICMWy<^I$xfH07zV1J|^#W3$C NC#5X;17sTf{{R#))Y1R| literal 0 HcmV?d00001 diff --git a/vendor/qiniu/php-sdk/examples/prefop.php b/vendor/qiniu/php-sdk/examples/prefop.php new file mode 100644 index 0000000..1b8950a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/prefop.php @@ -0,0 +1,27 @@ +useHTTPS=true; + +$pfop = new PersistentFop($auth, $config); + +$id = "z2.01z201c4oyre6q1hgy00murnel0002nh"; + +// 查询持久化处理的进度和状态 +list($ret, $err) = $pfop->status($id); +echo "\n====> pfop avthumb status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php b/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php new file mode 100644 index 0000000..638ae3c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketAccessMode.php @@ -0,0 +1,27 @@ +putBucketAccessMode($bucket, $private); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php b/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php new file mode 100644 index 0000000..3cc2aec --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketAccessStyleMode.php @@ -0,0 +1,27 @@ +putBucketAccessStyleMode($bucket, $mode); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketEvent.php b/vendor/qiniu/php-sdk/examples/put_bucketEvent.php new file mode 100644 index 0000000..f3c830d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketEvent.php @@ -0,0 +1,32 @@ +putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php b/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php new file mode 100644 index 0000000..4890174 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketMaxAge.php @@ -0,0 +1,27 @@ +putBucketMaxAge($bucket, $maxAge); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_bucketQuota.php b/vendor/qiniu/php-sdk/examples/put_bucketQuota.php new file mode 100644 index 0000000..b00ec48 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_bucketQuota.php @@ -0,0 +1,29 @@ +putBucketQuota($bucket, $size, $count); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php b/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php new file mode 100644 index 0000000..7d56d1e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/put_referAntiLeech.php @@ -0,0 +1,30 @@ +putReferAntiLeech($bucket, $mode, $norefer, $pattern); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/qetag.php b/vendor/qiniu/php-sdk/examples/qetag.php new file mode 100644 index 0000000..1fe90d1 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/qetag.php @@ -0,0 +1,14 @@ +useHTTPS = true; // 接口是否使用 HTTPS 协议 + +$bucketManager = new BucketManager($auth, $config); + +// 异步第三方资源抓取 +// 参考文档:https://developer.qiniu.com/kodo/api/4097/asynch-fetch + +// 需要抓取的文件 URL +$url = 'http://devtools.qiniu.com/qiniu.png'; + +//回调 URL(需要可以公网访问,并能够相应 200 OK) +$callbackurl = "http://your.domain.com/upload_verify_callback.php"; + +// 回调Body +$callbackbody = '{"key":"$(key)","hash":"$(etag)","w":"$(imageInfo.width)","h":"$(imageInfo.height)"}'; + + +//---------------------------------------- demo1 ---------------------------------------- +// 指定抓取的文件保存到七牛云空间中的名称 + +$key = time() . '.png'; +list($ret, $err) = $bucketManager->asynchFetch($url, $bucket, null, $key, null, null, $callbackurl, $callbackbody); +echo "=====> asynch fetch $url to bucket: $bucket key: $key\n"; +if ($err !== null) { + var_dump($err); +} else { + $id = $ret['id']; + echo "id is: $id\n"; +} + +//---------------------------------------- demo2 ---------------------------------------- +// 不指定 key 时,以文件内容的 hash 作为文件名 + +$key = null; +list($ret, $err) = $bucketManager->asynchFetch($url, $bucket, null, $key, null, null, $callbackurl, $callbackbody); +echo "=====> asynch fetch $url to bucket: $bucket key: $(etag)\n"; +if ($err !== null) { + var_dump($err); +} else { + $id = $ret['id']; + echo "id is: $id\n"; +} + +// 查询异步抓取的进度和状态 + +// 华东:z0,华北:z1,华南:z2,北美:na0,东南亚:as0 +$zone = 'z2'; + +sleep(10); // 由于异步抓取需要耗时,等待 10 秒后再查询状态 +list($ret, $err) = $bucketManager->asynchFetchStatus($zone, $id); +echo "\n====> asynch fetch status: \n"; +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php b/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php new file mode 100644 index 0000000..c5bd6b4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_change_mime.php @@ -0,0 +1,32 @@ + 'video/x-mp4', + 'qiniu.png' => 'image/x-png', + 'qiniu.jpg' => 'image/x-jpg' +); + +$ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php b/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php new file mode 100644 index 0000000..6c8df84 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_change_type.php @@ -0,0 +1,44 @@ +batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_copy.php b/vendor/qiniu/php-sdk/examples/rs_batch_copy.php new file mode 100644 index 0000000..66c4d4d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_copy.php @@ -0,0 +1,40 @@ +buildBatchCopy($srcBucket, $keyPairs, $destBucket, true); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_delete.php b/vendor/qiniu/php-sdk/examples/rs_batch_delete.php new file mode 100644 index 0000000..ebcdbe6 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_delete.php @@ -0,0 +1,32 @@ +buildBatchDelete($bucket, $keys); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php b/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php new file mode 100644 index 0000000..928dd14 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_delete_after_days.php @@ -0,0 +1,39 @@ +buildBatchDeleteAfterDays($bucket, $keyDayPairs); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_move.php b/vendor/qiniu/php-sdk/examples/rs_batch_move.php new file mode 100644 index 0000000..01d8c91 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_move.php @@ -0,0 +1,40 @@ +buildBatchMove($srcBucket, $keyPairs, $destBucket, true); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php b/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php new file mode 100644 index 0000000..b2f79d0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_restore_ar.php @@ -0,0 +1,41 @@ +batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_batch_stat.php b/vendor/qiniu/php-sdk/examples/rs_batch_stat.php new file mode 100644 index 0000000..88bc32e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_batch_stat.php @@ -0,0 +1,32 @@ +buildBatchStat($bucket, $keys); +list($ret, $err) = $bucketManager->batch($ops); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php b/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php new file mode 100644 index 0000000..3cc9cb3 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_bucket_domains.php @@ -0,0 +1,26 @@ +domains($bucket); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_buckets.php b/vendor/qiniu/php-sdk/examples/rs_buckets.php new file mode 100644 index 0000000..84263a9 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_buckets.php @@ -0,0 +1,25 @@ +buckets(true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_mime.php b/vendor/qiniu/php-sdk/examples/rs_change_mime.php new file mode 100644 index 0000000..f4442aa --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_mime.php @@ -0,0 +1,29 @@ +changeMime($bucket, $key, $newMime); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_status.php b/vendor/qiniu/php-sdk/examples/rs_change_status.php new file mode 100644 index 0000000..bedf61c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_status.php @@ -0,0 +1,29 @@ +changeStatus($bucket, $key, $status); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_type.php b/vendor/qiniu/php-sdk/examples/rs_change_type.php new file mode 100644 index 0000000..802c9f4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_type.php @@ -0,0 +1,31 @@ +changeType($bucket, $key, $fileType); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_copy.php b/vendor/qiniu/php-sdk/examples/rs_copy.php new file mode 100644 index 0000000..aae4d96 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_copy.php @@ -0,0 +1,33 @@ +copy($srcBucket, $srcKey, $destBucket, $destKey, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_delete.php b/vendor/qiniu/php-sdk/examples/rs_delete.php new file mode 100644 index 0000000..ad97266 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_delete.php @@ -0,0 +1,27 @@ +delete($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php b/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php new file mode 100644 index 0000000..96e55de --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_delete_after_days.php @@ -0,0 +1,26 @@ +deleteAfterDays($bucket, $key, $days); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_download_urls.php b/vendor/qiniu/php-sdk/examples/rs_download_urls.php new file mode 100644 index 0000000..e803ddc --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_download_urls.php @@ -0,0 +1,19 @@ +/,一定要带访问协议,也就是 http:// 或者 https:// +$baseUrl = 'http://if-pri.qiniudn.com/qiniu.png?imageView2/1/h/500'; + +// 对链接进行签名,参考文档:https://developer.qiniu.com/kodo/manual/1656/download-private +$signedUrl = $auth->privateDownloadUrl($baseUrl); + +echo $signedUrl; diff --git a/vendor/qiniu/php-sdk/examples/rs_fetch.php b/vendor/qiniu/php-sdk/examples/rs_fetch.php new file mode 100644 index 0000000..5c1a5ab --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_fetch.php @@ -0,0 +1,43 @@ +fetch($url, $bucket, $key); +echo "=====> fetch $url to bucket: $bucket key: $key\n"; +if ($err !== null) { + var_dump($err); +} else { + print_r($ret); +} + +//---------------------------------------- demo2 ---------------------------------------- +// 不指定 key 时,以文件内容的 hash 作为文件名 + +$key = null; +list($ret, $err) = $bucketManager->fetch($url, $bucket, $key); +echo "=====> fetch $url to bucket: $bucket key: $(etag)\n"; +if ($err !== null) { + var_dump($err); +} else { + print_r($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_move.php b/vendor/qiniu/php-sdk/examples/rs_move.php new file mode 100644 index 0000000..a399665 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_move.php @@ -0,0 +1,29 @@ +move($srcBucket, $srcKey, $destBucket, $destKey, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_prefetch.php b/vendor/qiniu/php-sdk/examples/rs_prefetch.php new file mode 100644 index 0000000..28af115 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_prefetch.php @@ -0,0 +1,25 @@ +prefetch($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_restore.php b/vendor/qiniu/php-sdk/examples/rs_restore.php new file mode 100644 index 0000000..a3bf070 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_restore.php @@ -0,0 +1,28 @@ +restoreAr($bucket, $key, 1); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_stat.php b/vendor/qiniu/php-sdk/examples/rs_stat.php new file mode 100644 index 0000000..36e863e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_stat.php @@ -0,0 +1,28 @@ +stat($bucket, $key); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php b/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php new file mode 100644 index 0000000..97a5838 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_list_bucket.php @@ -0,0 +1,47 @@ +listFiles($bucket, $prefix, $marker, $limit, $delimiter); + if ($err !== null) { + echo "\n====> list file err: \n"; + var_dump($err); + } else { + $marker = null; + if (array_key_exists('marker', $ret)) { + $marker = $ret['marker']; + } + echo "Marker: $marker\n"; + echo "\nList Items====>\n"; + //var_dump($ret['items']); + print('items count:' . count($ret['items']) . "\n"); + if (array_key_exists('commonPrefixes', $ret)) { + print_r($ret['commonPrefixes']); + } + } +} while (!empty($marker)); diff --git a/vendor/qiniu/php-sdk/examples/rsf_list_files.php b/vendor/qiniu/php-sdk/examples/rsf_list_files.php new file mode 100644 index 0000000..31c455b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_list_files.php @@ -0,0 +1,39 @@ +listFiles($bucket, $prefix, $marker, $limit, $delimiter); +if ($err !== null) { + echo "\n====> list file err: \n"; + var_dump($err); +} else { + if (array_key_exists('marker', $ret)) { + echo "Marker:" . $ret["marker"] . "\n"; + } + echo "\nList Iterms====>\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php b/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php new file mode 100644 index 0000000..5f9d763 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rsf_v2list_bucket.php @@ -0,0 +1,34 @@ +listFilesv2($bucket, $prefix, $marker, $limit, $delimiter, true); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/README.md b/vendor/qiniu/php-sdk/examples/rtc/README.md new file mode 100644 index 0000000..c7fff4d --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/README.md @@ -0,0 +1,34 @@ +# Rtc Streaming Cloud Server-Side Library For PHP + +## Features + +- RoomToken 签发 + - [x] 生成 RoomToken: client->appToken() + +- App 管理 + - [x] 创建应用: client->createApp() + - [x] 获取应用配置信息: client->getApp() + - [x] 更新应用配置信息: client->updateApp() + - [x] 删除应用: client->deleteApp() + +- 房间管理 + - [x] 列举房间下的所有用户: client->listUser() + - [x] 指定一个用户踢出房间: client->kickUser() + - [x] 停止一个房间的合流转推: client->stopMerge() + - [x] 获取当前所有活跃的房间: client->listActiveRooms() + +## Demo +- RoomToken 签发 + - [生成 RoomToken](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_create_roomToken.php) + +- App 管理 + - [创建应用](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_createApp.php) + - [获取应用配置信息](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_getApp.php) + - [更新应用配置信息](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_updateApp.php) + - [删除应用](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_deleteApp.php) + +- 房间管理 + - [列举房间下的所有用户](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_listUser.php) + - [指定一个用户踢出房间](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_kickUser.php) + - [停止一个房间的合流转推](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_stopMerge.php) + - [获取当前所有活跃的房间](https://github.com/qiniu/php-sdk/tree/master/examples/rtc/rtc_rooms_listActiveRooms.php) \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php new file mode 100644 index 0000000..039eadd --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_createApp.php @@ -0,0 +1,32 @@ +createApp($hub, $title, $maxUsers); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Create Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php new file mode 100644 index 0000000..6a62aa2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_create_roomToken.php @@ -0,0 +1,34 @@ +appToken($appId, $roomName, $userId, $expireAt, $permission); +echo "\n====> Create RoomToken Successfully: \n"; +var_dump($RoomToken); diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php new file mode 100644 index 0000000..68bff33 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_deleteApp.php @@ -0,0 +1,25 @@ +deleteApp($appId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete $appId Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php new file mode 100644 index 0000000..9f8e374 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_getApp.php @@ -0,0 +1,26 @@ +getApp($appId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> $appId Conf: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php new file mode 100644 index 0000000..019c3f2 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_kickUser.php @@ -0,0 +1,31 @@ +kickUser($appId, $roomName, $userId); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Kick User $userId Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php new file mode 100644 index 0000000..16e6027 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listActiveRooms.php @@ -0,0 +1,35 @@ +listActiveRooms($appId, $prefix, $offset, $limit); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Active Rooms:\n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php new file mode 100644 index 0000000..a839728 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_listUser.php @@ -0,0 +1,29 @@ +listUser($appId, $roomName); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> User List: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php new file mode 100644 index 0000000..e140907 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_rooms_stopMerge.php @@ -0,0 +1,28 @@ +stopMerge($appId, $roomName); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Stop Merge Successfully \n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php b/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php new file mode 100644 index 0000000..f771075 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rtc/rtc_updateApp.php @@ -0,0 +1,40 @@ +updateApp($appId, $hub, $title, $maxUsers, false, $mergePublishRtmp); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update $appId Conf Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/saveas.php b/vendor/qiniu/php-sdk/examples/saveas.php new file mode 100644 index 0000000..5d51ef4 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/saveas.php @@ -0,0 +1,33 @@ +为生成缩略图的文件名 +$entry = ':'; + +// 生成的值 +$encodedEntryURI = \Qiniu\base64_urlSafeEncode($entry); + +// 使用 SecretKey 对新的下载 URL 进行 HMAC1-SHA1 签名 +$newurl = "78re52.com1.z0.glb.clouddn.com/resource/Ship.jpg?imageView2/2/w/200/h/200|saveas/" . $encodedEntryURI; + +$sign = hash_hmac("sha1", $newurl, $secretKey, true); + +// 对签名进行 URL 安全的 Base64 编码 +$encodedSign = \Qiniu\base64_urlSafeEncode($sign); + +// 最终得到的完整下载 URL +$finalURL = "http://" . $newurl . "/sign/" . $accessKey . ":" . $encodedSign; + +$callbackBody = file_get_contents("$finalURL"); + +echo $callbackBody; diff --git a/vendor/qiniu/php-sdk/examples/sms/README.md b/vendor/qiniu/php-sdk/examples/sms/README.md new file mode 100644 index 0000000..8c80a38 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/README.md @@ -0,0 +1,45 @@ +# SMS Server-Side Library For PHP + +## Features + +- 签名管理 + - [x] 创建签名: client->createSignature() + - [x] 列出签名: client->checkSignature() + - [x] 查询单个签名: client->checkSingleSignature() + - [x] 编辑签名: client->updateSignature() + - [x] 删除签名: client->deleteSignature() + +- 模板管理 + - [x] 创建模板: client->createTemplate() + - [x] 列出模板: client->queryTemplate() + - [x] 查询单个模板: client->querySingleTemplate() + - [x] 编辑模板: client->updateTemplate() + - [x] 删除模板: client->deleteTemplate() + +- 发送短信 + - [x] 发送短信: client->sendMessage() + +- 查询发送记录 + - [x] 查询发送记录: client->querySendSms() + +## Demo + +- 签名管理 + - [创建签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_create_signature.php) + - [列出签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_signature.php) + - [查询单个签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_single_signature.php) + - [编辑签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_edit_signature.php) + - [删除签名](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_delete_signature.php) + +- 模板管理 + - [创建模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_create_template.php) + - [列出模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_template.php) + - [查询单个模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_single_template.php) + - [编辑模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_edit_template.php) + - [删除模板](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_delete_template.php) + +- 发送短信 + - [发送短信](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_send_message.php) + +- 查询发送记录 + - [查询发送记录](https://github.com/qiniu/php-sdk/tree/master/examples/sms/sms_query_send_sms.php) diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php new file mode 100644 index 0000000..ea1f158 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_create_signature.php @@ -0,0 +1,29 @@ +createSignature($signature, $source, $pics); + +echo "\n====> create signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php new file mode 100644 index 0000000..3cb3874 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_create_template.php @@ -0,0 +1,33 @@ +createTemplate($name, $template, $type, $description, $signature_id); + +echo "\n====> create signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php new file mode 100644 index 0000000..fd873fa --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_delete_signature.php @@ -0,0 +1,25 @@ +deleteSignature($signature_id); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete Signature $signature_id Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php new file mode 100644 index 0000000..4590835 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_delete_template.php @@ -0,0 +1,25 @@ +deleteTemplate($template_id); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Delete Template $template_id Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php new file mode 100644 index 0000000..edf14e0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_edit_signature.php @@ -0,0 +1,30 @@ +updateSignature($id, $signature, $source, $pics); + +echo "\n====> edit signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update Signature Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php new file mode 100644 index 0000000..1be5509 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_edit_template.php @@ -0,0 +1,31 @@ +updateTemplate($template_id, $name, $template, $description, $signature_id); + +echo "\n====> edit template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Update Template Successfully\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php new file mode 100644 index 0000000..cdbbe71 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_send_sms.php @@ -0,0 +1,50 @@ +querySendSms( + $job_id, + $message_id, + $mobile, + $status, + $template_id, + $type, + $start, + $end, + $page, + $page_size +); +echo "\n====> query send sms result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php new file mode 100644 index 0000000..224d09b --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_signature.php @@ -0,0 +1,28 @@ +querySignature($audit_status, $page, $page_size); +echo "\n====> query signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php new file mode 100644 index 0000000..8afb4d5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_signature.php @@ -0,0 +1,26 @@ +checkSingleSignature($signature_id); +echo "\n====> query single signature result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php new file mode 100644 index 0000000..8e0b279 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_single_template.php @@ -0,0 +1,26 @@ +querySingleTemplate($template_id); +echo "\n====> query single template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php b/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php new file mode 100644 index 0000000..6be260e --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_query_template.php @@ -0,0 +1,28 @@ +queryTemplate($audit_status, $page, $page_size); +echo "\n====> query template result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php b/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php new file mode 100644 index 0000000..d943e52 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/sms/sms_send_message.php @@ -0,0 +1,32 @@ + 'xxxx'); + +list($ret, $err) = $client->sendMessage($template_id, $mobiles, $code); +if ($err !== null) { + var_dump($err); +} else { + echo "\n====> Send Message Successfully: \n"; + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/update_bucketEvent.php b/vendor/qiniu/php-sdk/examples/update_bucketEvent.php new file mode 100644 index 0000000..7b0d1d0 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/update_bucketEvent.php @@ -0,0 +1,31 @@ +updateBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php b/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php new file mode 100644 index 0000000..73f0f56 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/update_bucketLifecycleRule.php @@ -0,0 +1,36 @@ +updateBucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days, + $to_line_after_days +); +if ($err != null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_and_callback.php b/vendor/qiniu/php-sdk/examples/upload_and_callback.php new file mode 100644 index 0000000..a0c793a --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_and_callback.php @@ -0,0 +1,31 @@ + 'http://your.domain.com/upload_verify_callback.php', + 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)' +); +$uptoken = $auth->uploadToken($bucket, null, 3600, $policy); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +$uploadMgr = new UploadManager(); +list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_and_pfop.php b/vendor/qiniu/php-sdk/examples/upload_and_pfop.php new file mode 100644 index 0000000..32c1eb5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_and_pfop.php @@ -0,0 +1,49 @@ + $pfop, + 'persistentNotifyUrl' => $notifyUrl, + 'persistentPipeline' => $pipeline +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); + +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_mgr_init.php b/vendor/qiniu/php-sdk/examples/upload_mgr_init.php new file mode 100644 index 0000000..1164c90 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_mgr_init.php @@ -0,0 +1,19 @@ +uploadToken($bucket); + +// 构建 UploadManager 对象 +$uploadMgr = new UploadManager(); diff --git a/vendor/qiniu/php-sdk/examples/upload_multi_demos.php b/vendor/qiniu/php-sdk/examples/upload_multi_demos.php new file mode 100644 index 0000000..d724235 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_multi_demos.php @@ -0,0 +1,89 @@ +uploadToken($bucket); +$uploadMgr = new UploadManager(); + +//---------------------------------------- upload demo1 ---------------------------------------- +// 上传字符串到七牛 + +list($ret, $err) = $uploadMgr->put($token, null, 'content string'); +echo "\n====> put result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo2 ---------------------------------------- +// 上传文件到七牛 + +$filePath = './php-logo.png'; +$key = 'php-logo.png'; +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo3 ---------------------------------------- +// 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器. +// 可参考文档: https://developer.qiniu.com/kodo/manual/1206/put-policy + +$policy = array( + 'callbackUrl' => 'http://172.30.251.210/upload_verify_callback.php', + 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)' +// 'callbackBodyType' => 'application/json', +// 'callbackBody' => '{"filename":$(fname), "filesize": $(fsize)}' //设置application/json格式回调 +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); + + +list($ret, $err) = $uploadMgr->putFile($token, null, $key); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} + + +//---------------------------------------- upload demo4 ---------------------------------------- +// 上传视频,上传完成后进行 m3u8 的转码, 并给视频打水印 + +$wmImg = Qiniu\base64_urlSafeEncode('http://devtools.qiniudn.com/qiniu.png'); +$pfop = "avthumb/m3u8/wmImage/$wmImg"; + +// 转码完成后回调到业务服务器。(公网可以访问,并相应 200 OK) +$notifyUrl = 'http://notify.fake.com'; + +$policy = array( + 'persistentOps' => $pfop, + 'persistentNotifyUrl' => $notifyUrl, + 'persistentPipeline' => $pipeline +); +$token = $auth->uploadToken($bucket, null, 3600, $policy); +print($token); +list($ret, $err) = $uploadMgr->putFile($token, null, $key); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_simple_file.php b/vendor/qiniu/php-sdk/examples/upload_simple_file.php new file mode 100644 index 0000000..f495a02 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_simple_file.php @@ -0,0 +1,37 @@ +uploadToken($bucket); + +// 要上传文件的本地路径 +$filePath = './php-logo.png'; + +// 上传到七牛存储后保存的文件名 +$key = 'my-php-logo.png'; + +// 初始化 UploadManager 对象并进行文件的上传。 +$uploadMgr = new UploadManager(); + +// 调用 UploadManager 的 putFile 方法进行文件的上传,该方法会判断文件大小,进而决定使用表单上传还是分片上传,无需手动配置。 +list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_tokens.php b/vendor/qiniu/php-sdk/examples/upload_tokens.php new file mode 100644 index 0000000..d2cf02c --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_tokens.php @@ -0,0 +1,82 @@ +uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo2 ---------------------------------------- +// 自定义凭证有效期(示例2小时) + +$expires = 7200; +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo3 ---------------------------------------- +// 覆盖上传凭证 + +$expires = 3600; +$keyToOverwrite = 'qiniu.mp4'; +$upToken = $auth->uploadToken($bucket, $keyToOverwrite, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo4 ---------------------------------------- +// 自定义上传回复(非callback模式)凭证 + +$returnBody = '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}'; +$policy = array( + 'returnBody' => $returnBody +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo5 ---------------------------------------- +// 带回调业务服务器的凭证(application/json) + +$policy = array( + 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback', + 'callbackBody' => '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}', + 'callbackBodyType' => 'application/json' +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo6 ---------------------------------------- +// 带回调业务服务器的凭证(application/x-www-form-urlencoded) + +$policy = array( + 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback', + 'callbackBody' => 'key=$(key)&hash=$(etag)&bucket=$(bucket)&fsize=$(fsize)&name=$(x:name)' +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); + +//---------------------------------------- demo7 ---------------------------------------- +// 带数据处理的凭证 + +$saveMp4Entry = \Qiniu\base64_urlSafeEncode($bucket . ":avthumb_test_target.mp4"); +$saveJpgEntry = \Qiniu\base64_urlSafeEncode($bucket . ":vframe_test_target.jpg"); +$avthumbMp4Fop = "avthumb/mp4|saveas/" . $saveMp4Entry; +$vframeJpgFop = "vframe/jpg/offset/1|saveas/" . $saveJpgEntry; +$policy = array( + 'persistentOps' => $avthumbMp4Fop . ";" . $vframeJpgFop, + 'persistentPipeline' => "video-pipe", + 'persistentNotifyUrl' => "http://api.example.com/qiniu/pfop/notify", +); +$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true); +print($upToken . "\n"); diff --git a/vendor/qiniu/php-sdk/examples/upload_verify_callback.php b/vendor/qiniu/php-sdk/examples/upload_verify_callback.php new file mode 100644 index 0000000..dcb64c9 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_verify_callback.php @@ -0,0 +1,34 @@ +verifyCallback($contentType, $authorization, $url, $callbackBody); + +if ($isQiniuCallback) { + $resp = array('ret' => 'success'); +} else { + $resp = array('ret' => 'failed'); +} + +echo json_encode($resp); diff --git a/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php b/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php new file mode 100644 index 0000000..ce2b21f --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_with_qvmzone.php @@ -0,0 +1,40 @@ +uploadToken($bucket); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +// 七牛云主机QVM和七牛对象存储KODO内网上传,目前支持华东1区域(杭州)和华北2区域(北京)的云主机可以访问同区域的对象存储服务 +// 参考文档:https://developer.qiniu.com/qvm/manual/4269/qvm-kodo + +$zone = Zone::qvmZonez0(); // 华东:z0,华北:z1 +$config = new Config($zone); +$config->useHTTPS = true; + +// 指定 config +$uploadMgr = new UploadManager($config); + +list($ret, $err) = $uploadMgr->putFile($uptoken, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_with_zone.php b/vendor/qiniu/php-sdk/examples/upload_with_zone.php new file mode 100644 index 0000000..6192666 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/upload_with_zone.php @@ -0,0 +1,39 @@ +uploadToken($bucket); + +// 上传文件的本地路径 +$filePath = './php-logo.png'; + +// 指定 zone 上传 +// 参考文档:https://developer.qiniu.com/kodo/manual/1671/region-endpoint +$zone = Zone::zonez0(); // 华东:z0,华北:z1,华南:z2,北美:na0,东南亚:as0 +$config = new Config($zone); +$config->useHTTPS = true; + +// 指定 config +$uploadMgr = new UploadManager($config); + +list($ret, $err) = $uploadMgr->putFile($uptoken, $key, $filePath); +echo "\n====> putFile result: \n"; +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/phpunit.xml.dist b/vendor/qiniu/php-sdk/phpunit.xml.dist new file mode 100644 index 0000000..840f6e5 --- /dev/null +++ b/vendor/qiniu/php-sdk/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + tests + + + + diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Auth.php b/vendor/qiniu/php-sdk/src/Qiniu/Auth.php new file mode 100644 index 0000000..90231e9 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Auth.php @@ -0,0 +1,231 @@ +accessKey = $accessKey; + $this->secretKey = $secretKey; + } + + public function getAccessKey() + { + return $this->accessKey; + } + + public function sign($data) + { + $hmac = hash_hmac('sha1', $data, $this->secretKey, true); + return $this->accessKey . ':' . \Qiniu\base64_urlSafeEncode($hmac); + } + + public function signWithData($data) + { + $encodedData = \Qiniu\base64_urlSafeEncode($data); + return $this->sign($encodedData) . ':' . $encodedData; + } + + public function signRequest($urlString, $body, $contentType = null) + { + $url = parse_url($urlString); + $data = ''; + if (array_key_exists('path', $url)) { + $data = $url['path']; + } + if (array_key_exists('query', $url)) { + $data .= '?' . $url['query']; + } + $data .= "\n"; + + if ($body !== null && $contentType === 'application/x-www-form-urlencoded') { + $data .= $body; + } + return $this->sign($data); + } + + /** + * @param string $urlString + * @param string $method + * @param string $body + * @param null|Header $headers + */ + public function signQiniuAuthorization($urlString, $method = "GET", $body = "", $headers = null) + { + $url = parse_url($urlString); + if (!$url) { + return array(null, new \Exception("parse_url error")); + } + + // append method, path and query + if ($method === "") { + $data = "GET "; + } else { + $data = $method . " "; + } + if (isset($url["path"])) { + $data .= $url["path"]; + } + if (isset($url["query"])) { + $data .= "?" . $url["query"]; + } + + // append Host + $data .= "\n"; + $data .= "Host: "; + if (isset($url["host"])) { + $data .= $url["host"]; + } + if (isset($url["port"]) && $url["port"] > 0) { + $data .= ":" . $url["port"]; + } + + // try append content type + if ($headers != null && isset($headers["Content-Type"])) { + // append content type + $data .= "\n"; + $data .= "Content-Type: " . $headers["Content-Type"]; + } + + // try append xQiniuHeaders + if ($headers != null) { + $headerLines = array(); + $keyPrefix = "X-Qiniu-"; + foreach ($headers as $k => $v) { + if (strlen($k) > strlen($keyPrefix) && strpos($k, $keyPrefix) === 0) { + array_push( + $headerLines, + $k . ": " . $v + ); + } + } + if (count($headerLines) > 0) { + $data .= "\n"; + sort($headerLines); + $data .= implode("\n", $headerLines); + } + } + + // append body + $data .= "\n\n"; + if (!empty($body) > 0 + && isset($headers["Content-Type"]) + && $headers["Content-Type"] != "application/octet-stream" + ) { + $data .= $body; + } + + return array($this->sign(utf8_encode($data)), null); + } + + public function verifyCallback($contentType, $originAuthorization, $url, $body) + { + $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType); + return $originAuthorization === $authorization; + } + + public function privateDownloadUrl($baseUrl, $expires = 3600) + { + $deadline = time() + $expires; + + $pos = strpos($baseUrl, '?'); + if ($pos !== false) { + $baseUrl .= '&e='; + } else { + $baseUrl .= '?e='; + } + $baseUrl .= $deadline; + + $token = $this->sign($baseUrl); + return "$baseUrl&token=$token"; + } + + public function uploadToken($bucket, $key = null, $expires = 3600, $policy = null, $strictPolicy = true) + { + $deadline = time() + $expires; + $scope = $bucket; + if ($key !== null) { + $scope .= ':' . $key; + } + + $args = self::copyPolicy($args, $policy, $strictPolicy); + $args['scope'] = $scope; + $args['deadline'] = $deadline; + + $b = json_encode($args); + return $this->signWithData($b); + } + + /** + *上传策略,参数规格详见 + *http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html + */ + private static $policyFields = array( + 'callbackUrl', + 'callbackBody', + 'callbackHost', + 'callbackBodyType', + 'callbackFetchKey', + + 'returnUrl', + 'returnBody', + + 'endUser', + 'saveKey', + 'forceSaveKey', + 'insertOnly', + + 'detectMime', + 'mimeLimit', + 'fsizeMin', + 'fsizeLimit', + + 'persistentOps', + 'persistentNotifyUrl', + 'persistentPipeline', + + 'deleteAfterDays', + 'fileType', + 'isPrefixalScope', + ); + + private static function copyPolicy(&$policy, $originPolicy, $strictPolicy) + { + if ($originPolicy === null) { + return array(); + } + foreach ($originPolicy as $key => $value) { + if (!$strictPolicy || in_array((string)$key, self::$policyFields, true)) { + $policy[$key] = $value; + } + } + return $policy; + } + + public function authorization($url, $body = null, $contentType = null) + { + $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType); + return array('Authorization' => $authorization); + } + + public function authorizationV2($url, $method, $body = null, $contentType = null) + { + $headers = null; + $result = array(); + if ($contentType != null) { + $headers = new Header(array( + 'Content-Type' => array($contentType), + )); + $result['Content-Type'] = $contentType; + } + list($sign) = $this->signQiniuAuthorization($url, $method, $body, $headers); + $result['Authorization'] = 'Qiniu ' . $sign; + return $result; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php new file mode 100644 index 0000000..a6efced --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php @@ -0,0 +1,260 @@ +auth = $auth; + $this->server = 'http://fusion.qiniuapi.com'; + } + + /** + * @param array $urls 待刷新的文件链接数组 + * @return array + */ + public function refreshUrls(array $urls) + { + return $this->refreshUrlsAndDirs($urls, array()); + } + + /** + * @param array $dirs 待刷新的文件链接数组 + * @return array + * 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh + * 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category + */ + public function refreshDirs(array $dirs) + { + return $this->refreshUrlsAndDirs(array(), $dirs); + } + + /** + * @param array $urls 待刷新的文件链接数组 + * @param array $dirs 待刷新的目录链接数组 + * + * @return array 刷新的请求回复和错误,参考 examples/cdn_manager.php 代码 + * @link http://developer.qiniu.com/article/fusion/api/refresh.html + * + * 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh + * 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category + */ + public function refreshUrlsAndDirs(array $urls, array $dirs) + { + $req = array(); + if (!empty($urls)) { + $req['urls'] = $urls; + } + if (!empty($dirs)) { + $req['dirs'] = $dirs; + } + + $url = $this->server . '/v2/tune/refresh'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * 查询 CDN 刷新记录 + * + * @param string $requestId 指定要查询记录所在的刷新请求id + * @param string $isDir 指定是否查询目录,取值为 yes/no,默认不填则为两种类型记录都查询 + * @param array $urls 要查询的url列表,每个url可以是文件url,也可以是目录url + * @param string $state 指定要查询记录的状态,取值processing/success/failure + * @param int $pageNo 要求返回的页号,默认为0 + * @param int $pageSize 要求返回的页长度,默认为100 + * @param string $startTime 指定查询的开始日期,格式2006-01-01 + * @param string $endTime 指定查询的结束日期,格式2006-01-01 + * @return array + * @link https://developer.qiniu.com/fusion/api/1229/cache-refresh#4 + */ + public function getCdnRefreshList( + $requestId = null, + $isDir = null, + $urls = array(), + $state = null, + $pageNo = 0, + $pageSize = 100, + $startTime = null, + $endTime = null + ) { + $req = array(); + \Qiniu\setWithoutEmpty($req, 'requestId', $requestId); + \Qiniu\setWithoutEmpty($req, 'isDir', $isDir); + \Qiniu\setWithoutEmpty($req, 'urls', $urls); + \Qiniu\setWithoutEmpty($req, 'state', $state); + \Qiniu\setWithoutEmpty($req, 'pageNo', $pageNo); + \Qiniu\setWithoutEmpty($req, 'pageSize', $pageSize); + \Qiniu\setWithoutEmpty($req, 'startTime', $startTime); + \Qiniu\setWithoutEmpty($req, 'endTime', $endTime); + + $body = json_encode($req); + $url = $this->server . '/v2/tune/refresh/list'; + return $this->post($url, $body); + } + + /** + * @param array $urls 待预取的文件链接数组 + * + * @return array 预取的请求回复和错误,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/refresh.html + */ + public function prefetchUrls(array $urls) + { + $req = array( + 'urls' => $urls, + ); + + $url = $this->server . '/v2/tune/prefetch'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * 查询 CDN 预取记录 + * + * @param string $requestId 指定要查询记录所在的刷新请求id + * @param array $urls 要查询的url列表,每个url可以是文件url,也可以是目录url + * @param string $state 指定要查询记录的状态,取值processing/success/failure + * @param int $pageNo 要求返回的页号,默认为0 + * @param int $pageSize 要求返回的页长度,默认为100 + * @param string $startTime 指定查询的开始日期,格式2006-01-01 + * @param string $endTime 指定查询的结束日期,格式2006-01-01 + * @return array + * @link https://developer.qiniu.com/fusion/api/1227/file-prefetching#4 + */ + public function getCdnPrefetchList( + $requestId = null, + $urls = array(), + $state = null, + $pageNo = 0, + $pageSize = 100, + $startTime = null, + $endTime = null + ) { + $req = array(); + \Qiniu\setWithoutEmpty($req, 'requestId', $requestId); + \Qiniu\setWithoutEmpty($req, 'urls', $urls); + \Qiniu\setWithoutEmpty($req, 'state', $state); + \Qiniu\setWithoutEmpty($req, 'pageNo', $pageNo); + \Qiniu\setWithoutEmpty($req, 'pageSize', $pageSize); + \Qiniu\setWithoutEmpty($req, 'startTime', $startTime); + \Qiniu\setWithoutEmpty($req, 'endTime', $endTime); + + $body = json_encode($req); + $url = $this->server . '/v2/tune/prefetch/list'; + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取带宽数据的域名数组 + * @param string $startDate 开始的日期,格式类似 2017-01-01 + * @param string $endDate 结束的日期,格式类似 2017-01-01 + * @param string $granularity 获取数据的时间间隔,可以是 5min, hour 或者 day + * + * @return array 带宽数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html + */ + public function getBandwidthData(array $domains, $startDate, $endDate, $granularity) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['startDate'] = $startDate; + $req['endDate'] = $endDate; + $req['granularity'] = $granularity; + + $url = $this->server . '/v2/tune/bandwidth'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取流量数据的域名数组 + * @param string $startDate 开始的日期,格式类似 2017-01-01 + * @param string $endDate 结束的日期,格式类似 2017-01-01 + * @param string $granularity 获取数据的时间间隔,可以是 5min, hour 或者 day + * + * @return array 流量数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html + */ + public function getFluxData(array $domains, $startDate, $endDate, $granularity) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['startDate'] = $startDate; + $req['endDate'] = $endDate; + $req['granularity'] = $granularity; + + $url = $this->server . '/v2/tune/flux'; + $body = json_encode($req); + return $this->post($url, $body); + } + + /** + * @param array $domains 待获取日志下载链接的域名数组 + * @param string $logDate 获取指定日期的日志下载链接,格式类似 2017-01-01 + * + * @return array 日志下载链接数据和错误信息,参考 examples/cdn_manager.php 代码 + * + * @link http://developer.qiniu.com/article/fusion/api/log.html + */ + public function getCdnLogList(array $domains, $logDate) + { + $req = array(); + $req['domains'] = implode(';', $domains); + $req['day'] = $logDate; + + $url = $this->server . '/v2/tune/log/list'; + $body = json_encode($req); + return $this->post($url, $body); + } + + private function post($url, $body) + { + $headers = $this->auth->authorization($url, $body, 'application/json'); + $headers['Content-Type'] = 'application/json'; + $ret = Client::post($url, $body, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + /** + * 构建时间戳防盗链鉴权的访问外链 + * + * @param string $rawUrl 需要签名的资源url + * @param string $encryptKey 时间戳防盗链密钥 + * @param string $durationInSeconds 链接的有效期(以秒为单位) + * + * @return string 带鉴权信息的资源外链,参考 examples/cdn_timestamp_antileech.php 代码 + */ + public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durationInSeconds) + { + $parsedUrl = parse_url($rawUrl); + $deadline = time() + $durationInSeconds; + $expireHex = dechex($deadline); + $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; + $strToSign = $encryptKey . $path . $expireHex; + $signStr = md5($strToSign); + if (isset($parsedUrl['query'])) { + $signedUrl = $rawUrl . '&sign=' . $signStr . '&t=' . $expireHex; + } else { + $signedUrl = $rawUrl . '?sign=' . $signStr . '&t=' . $expireHex; + } + return $signedUrl; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Config.php b/vendor/qiniu/php-sdk/src/Qiniu/Config.php new file mode 100644 index 0000000..b93d99c --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Config.php @@ -0,0 +1,146 @@ +zone = $z; + $this->useHTTPS = false; + $this->useCdnDomains = false; + $this->regionCache = array(); + } + + public function getUpHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->srcUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->cdnUpHosts[0]; + } + + return $scheme . $host; + } + + public function getUpBackupHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + $host = $region->cdnUpHosts[0]; + if ($this->useCdnDomains === true) { + $host = $region->srcUpHosts[0]; + } + + return $scheme . $host; + } + + public function getRsHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->rsHost; + } + + public function getRsfHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->rsfHost; + } + + public function getIovipHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->iovipHost; + } + + public function getApiHost($accessKey, $bucket) + { + $region = $this->getRegion($accessKey, $bucket); + + if ($this->useHTTPS === true) { + $scheme = "https://"; + } else { + $scheme = "http://"; + } + + return $scheme . $region->apiHost; + } + + private function getRegion($accessKey, $bucket) + { + $cacheId = "$accessKey:$bucket"; + + if (isset($this->regionCache[$cacheId])) { + $region = $this->regionCache[$cacheId]; + } elseif (isset($this->zone)) { + $region = $this->zone; + $this->regionCache[$cacheId] = $region; + } else { + $region = Zone::queryZone($accessKey, $bucket); + if (is_array($region)) { + list($region, $err) = $region; + if ($err != null) { + throw new \Exception($err->message()); + } + } + $this->regionCache[$cacheId] = $region; + } + return $region; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php b/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php new file mode 100644 index 0000000..28afac8 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php @@ -0,0 +1,41 @@ + $val) { + array_push($data, '--' . $mimeBoundary); + array_push($data, "Content-Disposition: form-data; name=\"$key\""); + array_push($data, ''); + array_push($data, $val); + } + + array_push($data, '--' . $mimeBoundary); + $finalMimeType = empty($mimeType) ? 'application/octet-stream' : $mimeType; + $finalFileName = self::escapeQuotes($fileName); + array_push($data, "Content-Disposition: form-data; name=\"$name\"; filename=\"$finalFileName\""); + array_push($data, "Content-Type: $finalMimeType"); + array_push($data, ''); + array_push($data, $fileBody); + + array_push($data, '--' . $mimeBoundary . '--'); + array_push($data, ''); + + $body = implode("\r\n", $data); + // var_dump($data);exit; + $contentType = 'multipart/form-data; boundary=' . $mimeBoundary; + $headers['Content-Type'] = $contentType; + $request = new Request('POST', $url, $headers, $body); + return self::sendRequest($request); + } + + private static function userAgent() + { + $sdkInfo = "QiniuPHP/" . Config::SDK_VER; + + $systemInfo = php_uname("s"); + $machineInfo = php_uname("m"); + + $envInfo = "($systemInfo/$machineInfo)"; + + $phpVer = phpversion(); + + $ua = "$sdkInfo $envInfo PHP/$phpVer"; + return $ua; + } + + public static function sendRequest($request) + { + $t1 = microtime(true); + $ch = curl_init(); + $options = array( + CURLOPT_USERAGENT => self::userAgent(), + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_HEADER => true, + CURLOPT_NOBODY => false, + CURLOPT_CUSTOMREQUEST => $request->method, + CURLOPT_URL => $request->url, + ); + // Handle open_basedir & safe mode + if (!ini_get('safe_mode') && !ini_get('open_basedir')) { + $options[CURLOPT_FOLLOWLOCATION] = true; + } + if (!empty($request->headers)) { + $headers = array(); + foreach ($request->headers as $key => $val) { + array_push($headers, "$key: $val"); + } + $options[CURLOPT_HTTPHEADER] = $headers; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); + if (!empty($request->body)) { + $options[CURLOPT_POSTFIELDS] = $request->body; + } + curl_setopt_array($ch, $options); + $result = curl_exec($ch); + $t2 = microtime(true); + $duration = round($t2 - $t1, 3); + $ret = curl_errno($ch); + if ($ret !== 0) { + $r = new Response(-1, $duration, array(), null, curl_error($ch)); + curl_close($ch); + return $r; + } + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $headers = Header::parseRawText(substr($result, 0, $header_size)); + $body = substr($result, $header_size); + curl_close($ch); + return new Response($code, $duration, $headers, $body, null); + } + + private static function escapeQuotes($str) + { + $find = array("\\", "\""); + $replace = array("\\\\", "\\\""); + return str_replace($find, $replace, $str); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php new file mode 100644 index 0000000..73477cf --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php @@ -0,0 +1,35 @@ + + * {"error" : "detailed error message"} + * + */ +final class Error +{ + private $url; + private $response; + + public function __construct($url, $response) + { + $this->url = $url; + $this->response = $response; + } + + public function code() + { + return $this->response->statusCode; + } + + public function getResponse() + { + return $this->response; + } + + public function message() + { + return $this->response->error; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php new file mode 100644 index 0000000..7fa3faf --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Header.php @@ -0,0 +1,280 @@ + $values) { + $normalizedKey = self::normalizeKey($key); + $normalizedValues = array(); + foreach ($values as $value) { + array_push($normalizedValues, self::normalizeValue($value)); + } + $this->data[$normalizedKey] = $normalizedValues; + } + return $this; + } + + /** + * return origin headers, which is field name case-sensitive + * + * @param string $raw + * + * @return array + */ + public static function parseRawText($raw) + { + $headers = array(); + $headerLines = explode("\r\n", $raw); + foreach ($headerLines as $line) { + $headerLine = trim($line); + $kv = explode(':', $headerLine); + if (count($kv) <= 1) { + continue; + } + // for http2 [Pseudo-Header Fields](https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.1) + if ($kv[0] == "") { + $fieldName = ":" . $kv[1]; + } else { + $fieldName = $kv[0]; + } + $fieldValue = trim(substr($headerLine, strlen($fieldName . ":"))); + if (isset($headers[$fieldName])) { + array_push($headers[$fieldName], $fieldValue); + } else { + $headers[$fieldName] = array($fieldValue); + } + } + return $headers; + } + + /** + * @param string $raw + * + * @return Header + */ + public static function fromRawText($raw) + { + return new Header(self::parseRawText($raw)); + } + + /** + * @param string $key + * + * @return string + */ + public static function normalizeKey($key) + { + $key = trim($key); + + if (!self::isValidKeyName($key)) { + return $key; + } + + return ucwords(strtolower($key), '-'); + } + + /** + * @param string|numeric $value + * + * @return string|numeric + */ + public static function normalizeValue($value) + { + if (is_numeric($value)) { + return $value + 0; + } + return trim($value); + } + + /** + * @return array + */ + public function getRawData() + { + return $this->data; + } + + /** + * @param $offset string + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + $key = self::normalizeKey($offset); + return isset($this->data[$key]); + } + + /** + * @param $offset string + * + * @return string|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + $key = self::normalizeKey($offset); + if (isset($this->data[$key]) && count($this->data[$key])) { + return $this->data[$key][0]; + } else { + return null; + } + } + + /** + * @param $offset string + * @param $value string + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + $key = self::normalizeKey($offset); + if (isset($this->data[$key]) && count($this->data[$key]) > 0) { + $this->data[$key][0] = self::normalizeValue($value); + } else { + $this->data[$key] = array(self::normalizeValue($value)); + } + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $key = self::normalizeKey($offset); + unset($this->data[$key]); + } + + /** + * @return \ArrayIterator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + $arr = array(); + foreach ($this->data as $k => $v) { + $arr[$k] = $v[0]; + } + return new \ArrayIterator($arr); + } + + /** + * @return int + */ + #[\ReturnTypeWillChange] + public function count() + { + return count($this->data); + } + + private static $isTokenTable = array( + '!' => true, + '#' => true, + '$' => true, + '%' => true, + '&' => true, + '\'' => true, + '*' => true, + '+' => true, + '-' => true, + '.' => true, + '0' => true, + '1' => true, + '2' => true, + '3' => true, + '4' => true, + '5' => true, + '6' => true, + '7' => true, + '8' => true, + '9' => true, + 'A' => true, + 'B' => true, + 'C' => true, + 'D' => true, + 'E' => true, + 'F' => true, + 'G' => true, + 'H' => true, + 'I' => true, + 'J' => true, + 'K' => true, + 'L' => true, + 'M' => true, + 'N' => true, + 'O' => true, + 'P' => true, + 'Q' => true, + 'R' => true, + 'S' => true, + 'T' => true, + 'U' => true, + 'W' => true, + 'V' => true, + 'X' => true, + 'Y' => true, + 'Z' => true, + '^' => true, + '_' => true, + '`' => true, + 'a' => true, + 'b' => true, + 'c' => true, + 'd' => true, + 'e' => true, + 'f' => true, + 'g' => true, + 'h' => true, + 'i' => true, + 'j' => true, + 'k' => true, + 'l' => true, + 'm' => true, + 'n' => true, + 'o' => true, + 'p' => true, + 'q' => true, + 'r' => true, + 's' => true, + 't' => true, + 'u' => true, + 'v' => true, + 'w' => true, + 'x' => true, + 'y' => true, + 'z' => true, + '|' => true, + '~' => true, + ); + + /** + * @param string $str + * + * @return boolean + */ + private static function isValidKeyName($str) + { + for ($i = 0; $i < strlen($str); $i += 1) { + if (!isset(self::$isTokenTable[$str[$i]])) { + return false; + } + } + return true; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php new file mode 100644 index 0000000..43b0bfd --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Request.php @@ -0,0 +1,18 @@ +method = strtoupper($method); + $this->url = $url; + $this->headers = $headers; + $this->body = $body; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php new file mode 100644 index 0000000..bb50dd9 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Response.php @@ -0,0 +1,212 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-Status', + 208 => 'Already Reported', + 226 => 'IM Used', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Reserved for WebDAV advanced collections expired proposal', + 426 => 'Upgrade required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates (Experimental)', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ); + + /** + * @param int $code 状态码 + * @param double $duration 请求时长 + * @param array $headers 响应头部 + * @param string $body 响应内容 + * @param string $error 错误描述 + */ + public function __construct($code, $duration, array $headers = array(), $body = null, $error = null) + { + $this->statusCode = $code; + $this->duration = $duration; + $this->headers = array(); + $this->body = $body; + $this->error = $error; + $this->jsonData = null; + + if ($error !== null) { + return; + } + + foreach ($headers as $k => $vs) { + if (is_array($vs)) { + $this->headers[$k] = $vs[count($vs) - 1]; + } else { + $this->headers[$k] = $vs; + } + } + $this->normalizedHeaders = new Header($headers); + + if ($body === null) { + if ($code >= 400) { + $this->error = self::$statusTexts[$code]; + } + return; + } + if (self::isJson($this->normalizedHeaders)) { + try { + $jsonData = self::bodyJson($body); + if ($code >= 400) { + $this->error = $body; + if ($jsonData['error'] !== null) { + $this->error = $jsonData['error']; + } + } + $this->jsonData = $jsonData; + } catch (\InvalidArgumentException $e) { + $this->error = $body; + if ($code >= 200 && $code < 300) { + $this->error = $e->getMessage(); + } + } + } elseif ($code >= 400) { + $this->error = $body; + } + return; + } + + public function json() + { + return $this->jsonData; + } + + public function headers($normalized = false) + { + if ($normalized) { + return $this->normalizedHeaders; + } + return $this->headers; + } + + public function body() + { + return $this->body; + } + + private static function bodyJson($body) + { + return \Qiniu\json_decode((string) $body, true, 512); + } + + public function xVia() + { + $via = $this->normalizedHeaders['X-Via']; + if ($via === null) { + $via = $this->normalizedHeaders['X-Px']; + } + if ($via === null) { + $via = $this->normalizedHeaders['Fw-Via']; + } + return $via; + } + + public function xLog() + { + return $this->normalizedHeaders['X-Log']; + } + + public function xReqId() + { + return $this->normalizedHeaders['X-Reqid']; + } + + public function ok() + { + return $this->statusCode >= 200 && $this->statusCode < 300 && $this->error === null; + } + + public function needRetry() + { + $code = $this->statusCode; + if ($code < 0 || ($code / 100 === 5 and $code !== 579) || $code === 996) { + return true; + } + } + + private static function isJson($headers) + { + return isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'application/json') === 0; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php new file mode 100644 index 0000000..f5575ed --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php @@ -0,0 +1,292 @@ + + */ + public function thumbnail( + $url, + $mode, + $width, + $height, + $format = null, + $interlace = null, + $quality = null, + $ignoreError = 1 + ) { + + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + // 参数合法性效验 + if (!in_array(intval($mode), $this->modeArr, true)) { + return $url; + } + + if (!$width || !$height) { + return $url; + } + + $thumbStr = 'imageView2/' . $mode . '/w/' . $width . '/h/' . $height . '/'; + + // 拼接输出格式 + if (!is_null($format) + && in_array($format, $this->formatArr) + ) { + $thumbStr .= 'format/' . $format . '/'; + } + + // 拼接渐进显示 + if (!is_null($interlace) + && in_array(intval($interlace), array(0, 1), true) + ) { + $thumbStr .= 'interlace/' . $interlace . '/'; + } + + // 拼接图片质量 + if (!is_null($quality) + && intval($quality) >= 0 + && intval($quality) <= 100 + ) { + $thumbStr .= 'q/' . $quality . '/'; + } + + $thumbStr .= 'ignore-error/' . $ignoreError . '/'; + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $thumbStr; + } + + /** + * 图片水印 + * + * @param string $url 图片链接 + * @param string $image 水印图片链接 + * @param int $dissolve 透明度 + * @param string $gravity 水印位置 + * @param int $dx 横轴边距 + * @param int $dy 纵轴边距 + * @param int $watermarkScale 自适应原图的短边比例 + * @return string + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html + * @author Sherlock Ren + */ + public function waterImg( + $url, + $image, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null, + $watermarkScale = null + ) { + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + $waterStr = 'watermark/1/image/' . \Qiniu\base64_urlSafeEncode($image) . '/'; + + // 拼接水印透明度 + if (is_numeric($dissolve) + && $dissolve <= 100 + ) { + $waterStr .= 'dissolve/' . $dissolve . '/'; + } + + // 拼接水印位置 + if (in_array($gravity, $this->gravityArr, true)) { + $waterStr .= 'gravity/' . $gravity . '/'; + } + + // 拼接横轴边距 + if (!is_null($dx) + && is_numeric($dx) + ) { + $waterStr .= 'dx/' . $dx . '/'; + } + + // 拼接纵轴边距 + if (!is_null($dy) + && is_numeric($dy) + ) { + $waterStr .= 'dy/' . $dy . '/'; + } + + // 拼接自适应原图的短边比例 + if (!is_null($watermarkScale) + && is_numeric($watermarkScale) + && $watermarkScale > 0 + && $watermarkScale < 1 + ) { + $waterStr .= 'ws/' . $watermarkScale . '/'; + } + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $waterStr; + } + + /** + * 文字水印 + * + * @param string $url 图片链接 + * @param string $text 文字 + * @param string $font 文字字体 + * @param string $fontSize 文字字号 + * @param string $fontColor 文字颜色 + * @param int $dissolve 透明度 + * @param string $gravity 水印位置 + * @param int $dx 横轴边距 + * @param int $dy 纵轴边距 + * @return string + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark + * @author Sherlock Ren + */ + public function waterText( + $url, + $text, + $font = '黑体', + $fontSize = 0, + $fontColor = null, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null + ) { + // url合法效验 + if (!$this->isUrl($url)) { + return $url; + } + + $waterStr = 'watermark/2/text/' + . \Qiniu\base64_urlSafeEncode($text) . '/font/' + . \Qiniu\base64_urlSafeEncode($font) . '/'; + + // 拼接文字大小 + if (is_int($fontSize)) { + $waterStr .= 'fontsize/' . $fontSize . '/'; + } + + // 拼接文字颜色 + if (!is_null($fontColor) + && $fontColor + ) { + $waterStr .= 'fill/' . \Qiniu\base64_urlSafeEncode($fontColor) . '/'; + } + + // 拼接水印透明度 + if (is_numeric($dissolve) + && $dissolve <= 100 + ) { + $waterStr .= 'dissolve/' . $dissolve . '/'; + } + + // 拼接水印位置 + if (in_array($gravity, $this->gravityArr, true)) { + $waterStr .= 'gravity/' . $gravity . '/'; + } + + // 拼接横轴边距 + if (!is_null($dx) + && is_numeric($dx) + ) { + $waterStr .= 'dx/' . $dx . '/'; + } + + // 拼接纵轴边距 + if (!is_null($dy) + && is_numeric($dy) + ) { + $waterStr .= 'dy/' . $dy . '/'; + } + + // 如果有query_string用|线分割实现多参数 + return $url . ($this->hasQuery($url) ? '|' : '?') . $waterStr; + } + + /** + * 效验url合法性 + * + * @param string $url url链接 + * @return string + * @author Sherlock Ren + */ + protected function isUrl($url) + { + $urlArr = parse_url($url); + + return $urlArr['scheme'] + && in_array($urlArr['scheme'], array('http', 'https')) + && $urlArr['host'] + && $urlArr['path']; + } + + /** + * 检测是否有query + * + * @param string $url url链接 + * @return string + * @author Sherlock Ren + */ + protected function hasQuery($url) + { + $urlArr = parse_url($url); + + return !empty($urlArr['query']); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php new file mode 100644 index 0000000..7cdd352 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/Operation.php @@ -0,0 +1,60 @@ +auth = $auth; + $this->domain = $domain; + $this->token_expire = $token_expire; + } + + + /** + * 对资源文件进行处理 + * + * @param string $key 待处理的资源文件名 + * @param string $fops string|array fop操作,多次fop操作以array的形式传入。 + * eg. imageView2/1/w/200/h/200, imageMogr2/thumbnail/!75px + * + * @return array 文件处理后的结果及错误。 + * + * @link http://developer.qiniu.com/docs/v6/api/reference/fop/ + */ + public function execute($key, $fops) + { + $url = $this->buildUrl($key, $fops); + $resp = Client::get($url); + if (!$resp->ok()) { + return array(null, new Error($url, $resp)); + } + if ($resp->json() !== null) { + return array($resp->json(), null); + } + return array($resp->body, null); + } + + public function buildUrl($key, $fops, $protocol = 'http') + { + if (is_array($fops)) { + $fops = implode('|', $fops); + } + + $url = $protocol . "://$this->domain/$key?$fops"; + if ($this->auth !== null) { + $url = $this->auth->privateDownloadUrl($url, $this->token_expire); + } + + return $url; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php b/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php new file mode 100644 index 0000000..ac95d25 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php @@ -0,0 +1,94 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + } + + /** + * 对资源文件进行异步持久化处理 + * @param string $bucket 资源所在空间 + * @param string $key 待处理的源文件 + * @param string $fops string|array 待处理的pfop操作,多个pfop操作以array的形式传入。 + * eg. avthumb/mp3/ab/192k, vframe/jpg/offset/7/w/480/h/360 + * @param string $pipeline 资源处理队列 + * @param string $notify_url 处理结果通知地址 + * @param bool $force 是否强制执行一次新的指令 + * + * + * @return array 返回持久化处理的persistentId, 和返回的错误。 + * + * @link http://developer.qiniu.com/docs/v6/api/reference/fop/ + */ + public function execute($bucket, $key, $fops, $pipeline = null, $notify_url = null, $force = false) + { + if (is_array($fops)) { + $fops = implode(';', $fops); + } + $params = array('bucket' => $bucket, 'key' => $key, 'fops' => $fops); + \Qiniu\setWithoutEmpty($params, 'pipeline', $pipeline); + \Qiniu\setWithoutEmpty($params, 'notifyURL', $notify_url); + if ($force) { + $params['force'] = 1; + } + $data = http_build_query($params); + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::API_HOST . '/pfop/'; + $headers = $this->auth->authorization($url, $data, 'application/x-www-form-urlencoded'); + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + $response = Client::post($url, $data, $headers); + if (!$response->ok()) { + return array(null, new Error($url, $response)); + } + $r = $response->json(); + $id = $r['persistentId']; + return array($id, null); + } + + public function status($id) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::API_HOST . "/status/get/prefop?id=$id"; + $response = Client::get($url); + if (!$response->ok()) { + return array(null, new Error($url, $response)); + } + return array($response->json(), null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Region.php b/vendor/qiniu/php-sdk/src/Qiniu/Region.php new file mode 100644 index 0000000..eae21d1 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Region.php @@ -0,0 +1,196 @@ +srcUpHosts = $srcUpHosts; + $this->cdnUpHosts = $cdnUpHosts; + $this->rsHost = $rsHost; + $this->rsfHost = $rsfHost; + $this->apiHost = $apiHost; + $this->iovipHost = $iovipHost; + } + + //华东机房 + public static function regionHuadong() + { + $regionHuadong = new Region( + array("up.qiniup.com", 'up-jjh.qiniup.com', 'up-xs.qiniup.com'), + array('upload.qiniup.com', 'upload-jjh.qiniup.com', 'upload-xs.qiniup.com'), + 'rs.qbox.me', + 'rsf.qbox.me', + 'api.qiniu.com', + 'iovip.qbox.me' + ); + return $regionHuadong; + } + + //华东机房内网上传 + public static function qvmRegionHuadong() + { + $qvmRegionHuadong = new Region( + array("free-qvm-z0-xs.qiniup.com"), + 'rs.qbox.me', + 'rsf.qbox.me', + 'api.qiniu.com', + 'iovip.qbox.me' + ); + return $qvmRegionHuadong; + } + + //华北机房内网上传 + public static function qvmRegionHuabei() + { + $qvmRegionHuabei = new Region( + array("free-qvm-z1-zz.qiniup.com"), + "rs-z1.qbox.me", + "rsf-z1.qbox.me", + "api-z1.qiniu.com", + "iovip-z1.qbox.me" + ); + return $qvmRegionHuabei; + } + + //华北机房 + public static function regionHuabei() + { + $regionHuabei = new Region( + array('up-z1.qiniup.com'), + array('upload-z1.qiniup.com'), + "rs-z1.qbox.me", + "rsf-z1.qbox.me", + "api-z1.qiniu.com", + "iovip-z1.qbox.me" + ); + + return $regionHuabei; + } + + //华南机房 + public static function regionHuanan() + { + $regionHuanan = new Region( + array('up-z2.qiniup.com', 'up-dg.qiniup.com', 'up-fs.qiniup.com'), + array('upload-z2.qiniup.com', 'upload-dg.qiniup.com', 'upload-fs.qiniup.com'), + "rs-z2.qbox.me", + "rsf-z2.qbox.me", + "api-z2.qiniu.com", + "iovip-z2.qbox.me" + ); + return $regionHuanan; + } + + //北美机房 + public static function regionNorthAmerica() + { + //北美机房 + $regionNorthAmerica = new Region( + array('up-na0.qiniup.com'), + array('upload-na0.qiniup.com'), + "rs-na0.qbox.me", + "rsf-na0.qbox.me", + "api-na0.qiniu.com", + "iovip-na0.qbox.me" + ); + return $regionNorthAmerica; + } + + //新加坡机房 + public static function regionSingapore() + { + //新加坡机房 + $regionSingapore = new Region( + array('up-as0.qiniup.com'), + array('upload-as0.qiniup.com'), + "rs-as0.qbox.me", + "rsf-as0.qbox.me", + "api-as0.qiniu.com", + "iovip-as0.qbox.me" + ); + return $regionSingapore; + } + + /* + * GET /v2/query?ak=&&bucket= + **/ + public static function queryRegion($ak, $bucket) + { + $Region = new Region(); + $url = Config::API_HOST . '/v2/query' . "?ak=$ak&bucket=$bucket"; + $ret = Client::Get($url); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + //parse Region; + + $iovipHost = $r['io']['src']['main'][0]; + $Region->iovipHost = $iovipHost; + $accMain = $r['up']['acc']['main'][0]; + array_push($Region->cdnUpHosts, $accMain); + if (isset($r['up']['acc']['backup'])) { + foreach ($r['up']['acc']['backup'] as $key => $value) { + array_push($Region->cdnUpHosts, $value); + } + } + $srcMain = $r['up']['src']['main'][0]; + array_push($Region->srcUpHosts, $srcMain); + if (isset($r['up']['src']['backup'])) { + foreach ($r['up']['src']['backup'] as $key => $value) { + array_push($Region->srcUpHosts, $value); + } + } + + //set specific hosts + if (strstr($Region->iovipHost, "z1") !== false) { + $Region->rsHost = "rs-z1.qbox.me"; + $Region->rsfHost = "rsf-z1.qbox.me"; + $Region->apiHost = "api-z1.qiniu.com"; + } elseif (strstr($Region->iovipHost, "z2") !== false) { + $Region->rsHost = "rs-z2.qbox.me"; + $Region->rsfHost = "rsf-z2.qbox.me"; + $Region->apiHost = "api-z2.qiniu.com"; + } elseif (strstr($Region->iovipHost, "na0") !== false) { + $Region->rsHost = "rs-na0.qbox.me"; + $Region->rsfHost = "rsf-na0.qbox.me"; + $Region->apiHost = "api-na0.qiniu.com"; + } elseif (strstr($Region->iovipHost, "as0") !== false) { + $Region->rsHost = "rs-as0.qbox.me"; + $Region->rsfHost = "rsf-as0.qbox.me"; + $Region->apiHost = "api-as0.qiniu.com"; + } else { + $Region->rsHost = "rs.qbox.me"; + $Region->rsfHost = "rsf.qbox.me"; + $Region->apiHost = "api.qiniu.com"; + } + + return $Region; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php new file mode 100644 index 0000000..4f45aae --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php @@ -0,0 +1,234 @@ +auth = $auth; + + $this->baseURL = sprintf("%s/%s/apps", Config::RTCAPI_HOST, Config::RTCAPI_VERSION); + } + + /** + * 创建应用 + * + * @param string $hub 绑定的直播 hub + * @param string $title app 的名称 注意,Title 不是唯一标识,重复 create 动作将生成多个 app + * @param int $maxUsers 连麦房间支持的最大在线人数 + * @param bool $noAutoKickUser 禁止自动踢人(抢流),默认为 false + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null) + { + $params = array(); + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if ($noAutoKickUser !== null) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + $body = json_encode($params); + return $this->post($this->baseURL, $body); + } + + /** + * 更新一个应用的配置信息 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $hub app 的名称,可选 + * @param string $title 绑定的直播 hub,可选,用于合流后 rtmp 推流 + * @param int $maxUsers 连麦房间支持的最大在线人数,可选 + * @param bool $noAutoKickUser 禁止自动踢人,可选 + * @param null $mergePublishRtmp 连麦合流转推 RTMP 的配置,可选择。其详细配置可以参考文档 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function updateApp($appId, $hub, $title, $maxUsers = null, $noAutoKickUser = null, $mergePublishRtmp = null) + { + $url = $this->baseURL . '/' . $appId; + $params = array(); + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if ($noAutoKickUser !== null) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + if (!empty($mergePublishRtmp)) { + $params['mergePublishRtmp'] = $mergePublishRtmp; + } + $body = json_encode($params); + return $this->post($url, $body); + } + + /** + * 获取应用信息 + * + * @param string $appId + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function getApp($appId) + { + $url = $this->baseURL . '/' . $appId; + return $this->get($url); + } + + /** + * 删除应用 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_1 + */ + public function deleteApp($appId) + { + $url = $this->baseURL . '/' . $appId; + return $this->delete($url); + } + + /** + * 获取房间内用户列表 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 操作所查询的连麦房间 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function listUser($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName); + return $this->get($url); + } + + /** + * 指定一个用户踢出房间 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 连麦房间 + * @param string $userId 操作所剔除的用户 + * @return mixed + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function kickUser($appId, $roomName, $userId) + { + $url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId); + return $this->delete($url); + } + + /** + * 停止一个房间的合流转推 + * + * @param string $appId + * @param string $roomName + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function stopMerge($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/merge", $this->baseURL, $appId, $roomName); + return $this->delete($url); + } + + /** + * 获取应用中活跃房间 + * + * @param string $appId 连麦房间所属的 app + * @param null $prefix 所查询房间名的前缀索引,可以为空。 + * @param int $offset 分页查询的位移标记 + * @param int $limit 此次查询的最大长度 + * @return array + * @link https://doc.qnsdk.com/rtn/docs/server_overview#2_2 + */ + public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null) + { + $query = array(); + if (isset($prefix)) { + $query['prefix'] = $prefix; + } + if (isset($offset)) { + $query['offset'] = $offset; + } + if (isset($limit)) { + $query['limit'] = $limit; + } + if (isset($query) && !empty($query)) { + $query = '?' . http_build_query($query); + $url = sprintf("%s/%s/rooms%s", $this->baseURL, $appId, $query); + } else { + $url = sprintf("%s/%s/rooms", $this->baseURL, $appId); + } + return $this->get($url); + } + + /** + * 生成加入房间的令牌 + * + * @param string $appId app 的唯一标识,创建的时候由系统生成 + * @param string $roomName 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$ + * @param string $userId 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$ + * @param int $expireAt 鉴权的有效时间,传入以秒为单位的64位 Unix 绝对时间 + * @param string $permission 该用户的房间管理权限,"admin" 或 "user",默认为 "user" + * @return string + * @link https://doc.qnsdk.com/rtn/docs/server_overview#1 + */ + public function appToken($appId, $roomName, $userId, $expireAt, $permission) + { + $params = array(); + $params['appId'] = $appId; + $params['userId'] = $userId; + $params['roomName'] = $roomName; + $params['permission'] = $permission; + $params['expireAt'] = $expireAt; + $appAccessString = json_encode($params); + return $this->auth->signWithData($appAccessString); + } + + private function get($url, $cType = null) + { + $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); + $rtcToken['Content-Type'] = $cType; + $ret = Client::get($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::delete($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php b/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php new file mode 100644 index 0000000..625ec30 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Sms/Sms.php @@ -0,0 +1,380 @@ +auth = $auth; + + $this->baseURL = sprintf("%s/%s/", Config::SMS_HOST, Config::SMS_VERSION); + } + + /** + * 创建签名 + * + * @param string $signature 签名 + * @param string $source 签名来源,申请签名时必须指定签名来源 + * @param string $pics 签名对应的资质证明图片进行 base64 编码格式转换后的字符串,可选 + * @return array + * + * @link https://developer.qiniu.com/sms/api/5844/sms-api-create-signature + */ + public function createSignature($signature, $source, $pics = null) + { + $params = array(); + $params['signature'] = $signature; + $params['source'] = $source; + if (!empty($pics)) { + $params['pics'] = array($this->imgToBase64($pics)); + } + $body = json_encode($params); + $url = $this->baseURL . 'signature'; + return $this->post($url, $body); + } + + /** + * 编辑签名 + * + * @param string $id 签名 ID + * @param string $signature 签名 + * @param string $source 签名来源 + * @param string $pics 签名对应的资质证明图片进行 base64 编码格式转换后的字符串,可选 + * @return array + * @link https://developer.qiniu.com/sms/api/5890/sms-api-edit-signature + */ + public function updateSignature($id, $signature, $source, $pics = null) + { + $params = array(); + $params['signature'] = $signature; + $params['source'] = $source; + if (!empty($pics)) { + $params['pics'] = array($this->imgToBase64($pics)); + } + $body = json_encode($params); + $url = $this->baseURL . 'signature/' . $id; + return $this->PUT($url, $body); + } + + /** + * 列出签名 + * + * @param string $audit_status 审核状态:"passed"(通过), "rejected"(未通过), "reviewing"(审核中) + * @param int $page 页码。默认为 1 + * @param int $page_size 分页大小。默认为 20 + * @return array + * @link https://developer.qiniu.com/sms/api/5889/sms-api-query-signature + */ + public function querySignature($audit_status = null, $page = 1, $page_size = 20) + { + + $url = sprintf( + "%s?audit_status=%s&page=%s&page_size=%s", + $this->baseURL . 'signature', + $audit_status, + $page, + $page_size + ); + return $this->get($url); + } + + /** + * 查询单个签名 + * + * @param string $signature_id + * @return array + * @link https://developer.qiniu.com/sms/api/5970/query-a-single-signature + */ + public function checkSingleSignature($signature_id) + { + + $url = sprintf( + "%s/%s", + $this->baseURL . 'signature', + $signature_id + ); + return $this->get($url); + } + + /** + * 删除签名 + * + * @param string $signature_id 签名 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5891/sms-api-delete-signature + */ + public function deleteSignature($signature_id) + { + $url = $this->baseURL . 'signature/' . $signature_id; + return $this->delete($url); + } + + /** + * 创建模板 + * + * @param string $name 模板名称 + * @param string $template 模板内容 可设置自定义变量,发送短信时候使用,参考:${code} + * @param string $type notification:通知类,verification:验证码,marketing:营销类,voice:语音类 + * @param string $description 申请理由简述 + * @param string $signature_id 已经审核通过的签名 + * @return array array + * @link https://developer.qiniu.com/sms/api/5893/sms-api-create-template + */ + public function createTemplate( + $name, + $template, + $type, + $description, + $signature_id + ) { + $params = array(); + $params['name'] = $name; + $params['template'] = $template; + $params['type'] = $type; + $params['description'] = $description; + $params['signature_id'] = $signature_id; + + $body = json_encode($params); + $url = $this->baseURL . 'template'; + return $this->post($url, $body); + } + + /** + * 列出模板 + * + * @param string $audit_status 审核状态:passed (通过), rejected (未通过), reviewing (审核中) + * @param int $page 页码。默认为 1 + * @param int $page_size 分页大小。默认为 20 + * @return array + * @link https://developer.qiniu.com/sms/api/5894/sms-api-query-template + */ + public function queryTemplate($audit_status = null, $page = 1, $page_size = 20) + { + + $url = sprintf( + "%s?audit_status=%s&page=%s&page_size=%s", + $this->baseURL . 'template', + $audit_status, + $page, + $page_size + ); + return $this->get($url); + } + + /** + * 查询单个模版 + * + * @param string $template_id 模版ID + * @return array + * @link https://developer.qiniu.com/sms/api/5969/query-a-single-template + */ + public function querySingleTemplate($template_id) + { + + $url = sprintf( + "%s/%s", + $this->baseURL . 'template', + $template_id + ); + return $this->get($url); + } + + /** + * 编辑模板 + * + * @param string $id 模板 ID + * @param string $name 模板名称 + * @param string $template 模板内容 + * @param string $description 申请理由简述 + * @param string $signature_id 已经审核通过的签名 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5895/sms-api-edit-template + */ + public function updateTemplate( + $id, + $name, + $template, + $description, + $signature_id + ) { + $params = array(); + $params['name'] = $name; + $params['template'] = $template; + $params['description'] = $description; + $params['signature_id'] = $signature_id; + $body = json_encode($params); + $url = $this->baseURL . 'template/' . $id; + return $this->PUT($url, $body); + } + + /** + * 删除模板 + * + * @param string $template_id 模板 ID + * @return array + * @link https://developer.qiniu.com/sms/api/5896/sms-api-delete-template + */ + public function deleteTemplate($template_id) + { + $url = $this->baseURL . 'template/' . $template_id; + return $this->delete($url); + } + + /** + * 发送短信 + * + * @param string $template_id 模板 ID + * @param array $mobiles 手机号 + * @param array $parameters 自定义模板变量,变量设置在创建模板时,参数template指定 + * @return array + * @link https://developer.qiniu.com/sms/api/5897/sms-api-send-message + */ + public function sendMessage($template_id, $mobiles, $parameters = null) + { + $params = array(); + $params['template_id'] = $template_id; + $params['mobiles'] = $mobiles; + if (!empty($parameters)) { + $params['parameters'] = $parameters; + } + $body = json_encode($params); + $url = $this->baseURL . 'message'; + return $this->post($url, $body); + } + + /** + * 查询发送记录 + * + * @param string $job_id 发送任务返回的 id + * @param string $message_id 单条短信发送接口返回的 id + * @param string $mobile 接收短信的手机号码 + * @param string $status sending: 发送中,success: 发送成功,failed: 发送失败,waiting: 等待发送 + * @param string $template_id 模版 id + * @param string $type marketing:营销,notification:通知,verification:验证码,voice:语音 + * @param string $start 开始时间,timestamp,例如: 1563280448 + * @param int $end 结束时间,timestamp,例如: 1563280471 + * @param int $page 页码,默认为 1 + * @param int $page_size 每页返回的数据条数,默认20,最大200 + * @return array + * @link https://developer.qiniu.com/sms/api/5852/query-send-sms + */ + public function querySendSms( + $job_id = null, + $message_id = null, + $mobile = null, + $status = null, + $template_id = null, + $type = null, + $start = null, + $end = null, + $page = 1, + $page_size = 20 + ) { + $query = array(); + \Qiniu\setWithoutEmpty($query, 'job_id', $job_id); + \Qiniu\setWithoutEmpty($query, 'message_id', $message_id); + \Qiniu\setWithoutEmpty($query, 'mobile', $mobile); + \Qiniu\setWithoutEmpty($query, 'status', $status); + \Qiniu\setWithoutEmpty($query, 'template_id', $template_id); + \Qiniu\setWithoutEmpty($query, 'type', $type); + \Qiniu\setWithoutEmpty($query, 'start', $start); + \Qiniu\setWithoutEmpty($query, 'end', $end); + \Qiniu\setWithoutEmpty($query, 'page', $page); + \Qiniu\setWithoutEmpty($query, 'page_size', $page_size); + + $url = $this->baseURL . 'messages?' . http_build_query($query); + return $this->get($url); + } + + + public function imgToBase64($img_file) + { + $img_base64 = ''; + if (file_exists($img_file)) { + $app_img_file = $img_file; // 图片路径 + $img_info = getimagesize($app_img_file); // 取得图片的大小,类型等 + $fp = fopen($app_img_file, "r"); // 图片是否可读权限 + if ($fp) { + $filesize = filesize($app_img_file); + if ($filesize > 5 * 1024 * 1024) { + die("pic size < 5M !"); + } + $img_type = null; + $content = fread($fp, $filesize); + $file_content = chunk_split(base64_encode($content)); // base64编码 + switch ($img_info[2]) { //判读图片类型 + case 1: + $img_type = 'gif'; + break; + case 2: + $img_type = 'jpg'; + break; + case 3: + $img_type = 'png'; + break; + } + //合成图片的base64编码 + $img_base64 = 'data:image/' . $img_type . ';base64,' . $file_content; + } + fclose($fp); + } + + return $img_base64; + } + + private function get($url, $contentType = 'application/x-www-form-urlencoded') + { + $headers = $this->auth->authorizationV2($url, "GET", null, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::get($url, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::delete($url, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "POST", $body, $contentType); + + $headers['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + private function PUT($url, $body, $contentType = 'application/json') + { + $headers = $this->auth->authorizationV2($url, "PUT", $body, $contentType); + $headers['Content-Type'] = $contentType; + $ret = Client::put($url, $body, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php new file mode 100644 index 0000000..0f2baee --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php @@ -0,0 +1,123 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + } + + /** + * 视频审核 + * + * @param string $body body信息 + * + * @return array 成功返回NULL,失败返回对象Qiniu\Http\Error + * @link https://developer.qiniu.com/censor/api/5620/video-censor + */ + public function censorVideo($body) + { + $path = '/v3/video/censor'; + + return $this->arPost($path, $body); + } + + + /** + * 图片审核 + * + * @param string $body + * + * @return array 成功返回NULL,失败返回对象Qiniu\Http\Error + * @link https://developer.qiniu.com/censor/api/5588/image-censor + */ + public function censorImage($body) + { + $path = '/v3/image/censor'; + + return $this->arPost($path, $body); + } + + /** + * 查询视频审核结果 + * + * @param string $jobid 任务ID + * @return array + * @link https://developer.qiniu.com/censor/api/5620/video-censor + */ + public function censorStatus($jobid) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + $url = $scheme . Config::ARGUS_HOST . "/v3/jobs/video/$jobid"; + $response = $this->get($url); + if (!$response->ok()) { + print("statusCode: " . $response->statusCode); + return array(null, new Error($url, $response)); + } + return array($response->json(), null); + } + + private function getArHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::ARGUS_HOST; + } + + private function arPost($path, $body = null) + { + $url = $this->getArHost() . $path; + return $this->post($url, $body); + } + + private function get($url) + { + $headers = $this->auth->authorizationV2($url, 'GET'); + + return Client::get($url, $headers); + } + + private function post($url, $body) + { + $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); + $headers['Content-Type'] = 'application/json'; + $ret = Client::post($url, $body, $headers); + if (!$ret->ok()) { + print("statusCode: " . $ret->statusCode); + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + if (strstr($url, "video")) { + $jobid = $r['job']; + return array($jobid, null); + } + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php new file mode 100644 index 0000000..93fa267 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php @@ -0,0 +1,1110 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + } + + /** + * 获取指定账号下所有的空间名 + * + * @param bool $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @return array 包含所有空间名 + */ + public function buckets($shared = true) + { + $includeShared = "false"; + if ($shared === true) { + $includeShared = "true"; + } + return $this->rsGet('/buckets?shared=' . $includeShared); + } + + /** + * 列举空间,返回bucket列表 + * + * @param string $region 区域 + * @param string $line + * @param string $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @return array + */ + public function listbuckets( + $region = null, + $line = 'false', + $shared = 'false' + ) { + $path = '/v3/buckets?region=' . $region . '&line=' . $line . '&shared=' . $shared; + return $this->ucPost($path); + } + + /** + * 创建空间 + * + * @param string $name 创建的空间名 + * @param string $region 创建的区域,默认华东 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1382/mkbucketv3 + */ + public function createBucket($name, $region = 'z0') + { + $path = '/mkbucketv3/' . $name . '/region/' . $region; + return $this->rsPost($path, null); + } + + /** + * 删除空间 + * + * @param string $name 需要删除的目标空间名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1601/drop-bucket + */ + public function deleteBucket($name) + { + $path = '/drop/' . $name; + return $this->rsPost($path, null); + } + + /** + * 获取指定空间绑定的所有的域名 + * + * @param string $bucket 空间名称 + * @return array + */ + public function domains($bucket) + { + return $this->apiGet('/v6/domain/list?tbl=' . $bucket); + } + + /** + * 获取指定空间的相关信息 + * + * @param string $bucket 空间名称 + * @return array + */ + public function bucketInfo($bucket) + { + $path = '/v2/bucketInfo?bucket=' . $bucket; + return $this->ucPost($path); + } + + /** + * 获取指定zone的空间信息列表 + * + * @param string $region 区域 + * @param string $shared 指定共享空间,rw:读写权限空间,rd:读权限空间 + * @param string $fs 如果为 true,会返回每个空间当前的文件数和存储量(实时数据) + * @return array + */ + public function bucketInfos($region = null, $shared = 'false', $fs = 'false') + { + $path = '/v2/bucketInfos?region=' . $region . '&shared=' . $shared . '&fs=' . $fs; + return $this->ucPost($path); + } + + /** + * 列取空间的文件列表 + * + * @param string $bucket 空间名 + * @param string $prefix 列举前缀 + * @param string $marker 列举标识符 + * @param int $limit 单次列举个数限制 + * @param string $delimiter 指定目录分隔符 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1284/list + */ + public function listFiles( + $bucket, + $prefix = null, + $marker = null, + $limit = 1000, + $delimiter = null + ) { + $query = array('bucket' => $bucket); + \Qiniu\setWithoutEmpty($query, 'prefix', $prefix); + \Qiniu\setWithoutEmpty($query, 'marker', $marker); + \Qiniu\setWithoutEmpty($query, 'limit', $limit); + \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter); + $url = $this->getRsfHost() . '/list?' . http_build_query($query); + return $this->getV2($url); + } + + /** + * 列取空间的文件列表 + * + * @param string $bucket 空间名 + * @param string $prefix 列举前缀 + * @param string $marker 列举标识符 + * @param int $limit 单次列举个数限制 + * @param string $delimiter 指定目录分隔符 + * @param bool $skipconfirm 是否跳过已删除条目的确认机制 + * + * @return array + * @link http://developer.qiniu.com/docs/v6/api/reference/rs/list.html + */ + public function listFilesv2( + $bucket, + $prefix = null, + $marker = null, + $limit = 1000, + $delimiter = null, + $skipconfirm = true + ) { + $query = array('bucket' => $bucket); + \Qiniu\setWithoutEmpty($query, 'prefix', $prefix); + \Qiniu\setWithoutEmpty($query, 'marker', $marker); + \Qiniu\setWithoutEmpty($query, 'limit', $limit); + \Qiniu\setWithoutEmpty($query, 'delimiter', $delimiter); + \Qiniu\setWithoutEmpty($query, 'skipconfirm', $skipconfirm); + $path = '/v2/list?' . http_build_query($query); + $url = $this->getRsfHost() . $path; + $headers = $this->auth->authorizationV2($url, 'POST', null, 'application/x-www-form-urlencoded'); + $ret = Client::post($url, null, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = explode("\n", $ret->body); + array_pop($r); + return array($r, null); + } + + /** + * 增加bucket生命规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空,只能为 + * 字母、数字、下划线 + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param int $delete_after_days 指定上传文件多少天后删除,指定为0表示不删除, + * 大于0表示多少天后删除,需大于 to_line_after_days + * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示 + * 不转低频存储,小于0表示上传的文件立即变低频存储 + * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示 + * 不转归档存储,小于0表示上传的文件立即变归档存储 + * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示 + * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储 + * @return array + */ + public function bucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days = null, + $to_line_after_days = null, + $to_archive_after_days = null, + $to_deep_archive_after_days = null + ) { + $path = '/rules/add'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + if ($prefix) { + $params['prefix'] = $prefix; + } + if ($delete_after_days) { + $params['delete_after_days'] = $delete_after_days; + } + if ($to_line_after_days) { + $params['to_line_after_days'] = $to_line_after_days; + } + if ($to_archive_after_days) { + $params['to_archive_after_days'] = $to_archive_after_days; + } + if ($to_deep_archive_after_days) { + $params['to_deep_archive_after_days'] = $to_deep_archive_after_days; + } + $data = http_build_query($params); + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 更新bucket生命规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空,只能为字母、 + * 数字、下划线 + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param int $delete_after_days 指定上传文件多少天后删除,指定为0表示不删除, + * 大于0表示多少天后删除,需大于 to_line_after_days + * @param int $to_line_after_days 指定文件上传多少天后转低频存储。指定为0表示不 + * 转低频存储,小于0表示上传的文件立即变低频存储 + * @param int $to_archive_after_days 指定文件上传多少天后转归档存储。指定为0表示 + * 不转归档存储,小于0表示上传的文件立即变归档存储 + * @param int $to_deep_archive_after_days 指定文件上传多少天后转深度归档存储。指定为0表示 + * 不转深度归档存储,小于0表示上传的文件立即变深度归档存储 + * @return array + */ + public function updateBucketLifecycleRule( + $bucket, + $name, + $prefix, + $delete_after_days = null, + $to_line_after_days = null, + $to_archive_after_days = null, + $to_deep_archive_after_days = null + ) { + $path = '/rules/update'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + if ($prefix) { + $params['prefix'] = $prefix; + } + if ($delete_after_days) { + $params['delete_after_days'] = $delete_after_days; + } + if ($to_line_after_days) { + $params['to_line_after_days'] = $to_line_after_days; + } + if ($to_archive_after_days) { + $params['to_archive_after_days'] = $to_archive_after_days; + } + if ($to_deep_archive_after_days) { + $params['to_deep_archive_after_days'] = $to_deep_archive_after_days; + } + $data = http_build_query($params); + return $this->ucPost($path, $data); + } + + /** + * 获取bucket生命规则 + * + * @param string $bucket 空间名 + * @return array + */ + public function getBucketLifecycleRules($bucket) + { + $path = '/rules/get?bucket=' . $bucket; + $info = $this->ucGet($path); + return $info; + } + + /** + * 删除bucket生命规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @return array + */ + public function deleteBucketLifecycleRule($bucket, $name) + { + $path = '/rules/delete'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + $data = http_build_query($params); + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 增加bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param string $suffix 可选,文件配置的后缀 + * @param array $event 事件类型,可以指定多个,包括 put,mkfile,delete,copy,move,append, + * disable,enable,deleteMarkerCreate + * @param string $callbackURL 通知URL,可以指定多个,失败依次重试 + * @param string $access_key 可选,设置的话会对通知请求用对应的ak、sk进行签名 + * @param string $host 可选,通知请求的host + * + * @return array + */ + public function putBucketEvent( + $bucket, + $name, + $prefix, + $suffix, + $event, + $callbackURL, + $access_key = null, + $host = null + ) { + $path = '/events/add'; + $params = array(); + if (!empty($bucket)) { + $params['bucket'] = $bucket; + } + if (!empty($name)) { + $params['name'] = $name; + } + if (!empty($prefix)) { + $params['prefix'] = $prefix; + } + if (!empty($suffix)) { + $params['suffix'] = $suffix; + } + if (!empty($callbackURL)) { + $params['callbackURL'] = $callbackURL; + } + if (!empty($access_key)) { + $params['access_key'] = $access_key; + } + if (!empty($host)) { + $params['host'] = $host; + } + $data = http_build_query($params); + if (!empty($event)) { + $eventpath = ""; + foreach ($event as $key => $value) { + $eventpath .= "&event=$value"; + } + $data .= $eventpath; + } + $info = $this->ucPost($path, $data); + return $info; + } + + /** + * 更新bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称 bucket 内唯一,长度小于50,不能为空, + * 只能为字母、数字、下划线() + * @param string $prefix 同一个 bucket 里面前缀不能重复 + * @param string $suffix 可选,文件配置的后缀 + * @param array $event 事件类型,可以指定多个,包括 put,mkfile,delete,copy,move,append,disable, + * enable,deleteMarkerCreate + * @param string $callbackURL 通知URL,可以指定多个,失败依次重试 + * @param string $access_key 可选,设置的话会对通知请求用对应的ak、sk进行签名 + * @param string $host 可选,通知请求的host + * + * @return array + */ + public function updateBucketEvent( + $bucket, + $name, + $prefix, + $suffix, + $event, + $callbackURL, + $access_key = null, + $host = null + ) { + $path = '/events/update'; + $params = array(); + if (!empty($bucket)) { + $params['bucket'] = $bucket; + } + if (!empty($name)) { + $params['name'] = $name; + } + if (!empty($prefix)) { + $params['prefix'] = $prefix; + } + if ($suffix) { + $params['suffix'] = $suffix; + } + if (!empty($event)) { + $params['event'] = $event; + } + if (!empty($callbackURL)) { + $params['callbackURL'] = $callbackURL; + } + if (!empty($access_key)) { + $params['access_key'] = $access_key; + } + if (!empty($host)) { + $params['host'] = $host; + } + $data = http_build_query($params); + if (!empty($event)) { + $eventpath = ""; + foreach ($event as $key => $value) { + $eventpath .= "&event=$value"; + } + $data .= $eventpath; + } + return $this->ucPost($path, $data); + } + + /** + * 获取bucket事件通知规则 + * + * @param string $bucket 空间名 + * @return array + */ + public function getBucketEvents($bucket) + { + $path = '/events/get?bucket=' . $bucket; + return $this->ucGet($path); + } + + /** + * 删除bucket事件通知规则 + * + * @param string $bucket 空间名 + * @param string $name 规则名称bucket内唯一,长度小于50,不能为空,只能为字母、数字、下划线 + * @return array + */ + public function deleteBucketEvent($bucket, $name) + { + $path = '/events/delete'; + $params = array(); + if ($bucket) { + $params['bucket'] = $bucket; + } + if ($name) { + $params['name'] = $name; + } + $data = http_build_query($params); + return $this->ucPost($path, $data); + } + + /** + * 获取bucket的跨域信息 + * + * @param string $bucket 空间名 + * @return array + */ + public function getCorsRules($bucket) + { + $path = '/corsRules/get/' . $bucket; + return $this->ucGet($path); + } + + /** + * 开关原图保护 + * + * @param string $bucket 空间名称 + * @param int $mode mode 为1表示开启原图保护,0表示关闭 + * @return array + */ + public function putBucketAccessStyleMode($bucket, $mode) + { + $path = '/accessMode/' . $bucket . '/mode/' . $mode; + return $this->ucPost($path, null); + } + + /** + * 设置私有属性 + * + * @param string $bucket 空间名称 + * @param int $private private为0表示公开,为1表示私有 + * @return array + */ + public function putBucketAccessMode($bucket, $private) + { + $path = "/private?bucket=$bucket&private=$private"; + return $this->ucPost($path, null); + } + + /** + * 设置 referer 防盗链 + * + * @param string $bucket 空间名称 + * @param int $mode 0:关闭Referer(使用此选项将会忽略以下参数并将恢复默认值); + * 1:设置Referer白名单; 2:设置Referer黑名单 + * @param string $norefer 0:不允许空 Refer 访问; 1:表示允许空Refer访问 + * @param string $pattern 规则字符串 + * @param int $enabled 源站是否支持,默认为0只给CDN配置, 设置为1表示开启源站防盗链 + * @return array + * @link https://developer.qiniu.com/kodo/manual/6093/set-the-hotlinking-prevention + */ + public function putReferAntiLeech($bucket, $mode, $norefer, $pattern, $enabled = 1) + { + $path = "/referAntiLeech?bucket=$bucket&mode=$mode&norefer=$norefer&pattern=$pattern&source_enabled=$enabled"; + return $this->ucPost($path, null); + } + + /** + * 设置Bucket的maxAge + * + * @param string $bucket 空间名称 + * @param int $maxAge maxAge为0或者负数表示为默认值(31536000) + * @return array + */ + public function putBucketMaxAge($bucket, $maxAge) + { + $path = '/maxAge?bucket=' . $bucket . '&maxAge=' . $maxAge; + return $this->ucPost($path, null); + } + + /** + * 设置空间配额 + * + * @param string $bucket 空间名称,不支持授权空间 + * @param string $size 空间存储量配额,参数传入0或不传表示不更改当前配置,传入-1表示取消限额,新创建的空间默认没有限额 + * @param string $count 空间文件数配额,参数含义同 + * @return array + */ + public function putBucketQuota($bucket, $size, $count) + { + $path = '/setbucketquota/' . $bucket . '/size/' . $size . '/count/' . $count; + return $this->apiPost($path, null); + } + + /** + * 获取空间配额 + * + * @param string $bucket 空间名称 + * @return array + */ + public function getBucketQuota($bucket) + { + $path = '/getbucketquota/' . $bucket; + return $this->apiPost($path, null); + } + + /** + * 获取资源的元信息,但不返回文件内容 + * + * @param string $bucket 待获取信息资源所在的空间 + * @param string $key 待获取资源的文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1308/stat + */ + public function stat($bucket, $key) + { + $path = '/stat/' . \Qiniu\entry($bucket, $key); + return $this->rsGet($path); + } + + /** + * 删除指定资源 + * + * @param string $bucket 待删除资源所在的空间 + * @param string $key 待删除资源的文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1257/delete + */ + public function delete($bucket, $key) + { + $path = '/delete/' . \Qiniu\entry($bucket, $key); + return $this->rsPost($path); + } + + /** + * 给资源进行重命名,本质为move操作。 + * + * @param string $bucket 待操作资源所在空间 + * @param string $oldname 待操作资源文件名 + * @param string $newname 目标资源文件名 + * + * @return array + */ + public function rename($bucket, $oldname, $newname) + { + return $this->move($bucket, $oldname, $bucket, $newname); + } + + /** + * 对资源进行复制。 + * + * @param string $from_bucket 待操作资源所在空间 + * @param string $from_key 待操作资源文件名 + * @param string $to_bucket 目标资源空间名 + * @param string $to_key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1254/copy + */ + public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = false) + { + $from = \Qiniu\entry($from_bucket, $from_key); + $to = \Qiniu\entry($to_bucket, $to_key); + $path = '/copy/' . $from . '/' . $to; + if ($force === true) { + $path .= '/force/true'; + } + return $this->rsPost($path); + } + + /** + * 将资源从一个空间到另一个空间 + * + * @param string $from_bucket 待操作资源所在空间 + * @param string $from_key 待操作资源文件名 + * @param string $to_bucket 目标资源空间名 + * @param string $to_key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1288/move + */ + public function move($from_bucket, $from_key, $to_bucket, $to_key, $force = false) + { + $from = \Qiniu\entry($from_bucket, $from_key); + $to = \Qiniu\entry($to_bucket, $to_key); + $path = '/move/' . $from . '/' . $to; + if ($force) { + $path .= '/force/true'; + } + return $this->rsPost($path); + } + + /** + * 主动修改指定资源的文件元信息 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param string $mime 待操作文件目标mimeType + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1252/chgm + */ + public function changeMime($bucket, $key, $mime) + { + $resource = \Qiniu\entry($bucket, $key); + $encode_mime = \Qiniu\base64_urlSafeEncode($mime); + $path = '/chgm/' . $resource . '/mime/' . $encode_mime; + return $this->rsPost($path); + } + + + /** + * 修改指定资源的存储类型 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $fileType 0 表示标准存储;1 表示低频存储;2 表示归档存储;3 表示深度归档存储 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/3710/chtype + */ + public function changeType($bucket, $key, $fileType) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/chtype/' . $resource . '/type/' . $fileType; + return $this->rsPost($path); + } + + /** + * 解冻指定资源的存储类型 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $freezeAfterDays 解冻有效时长,取值范围 1~7 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/6380/restore-archive + */ + public function restoreAr($bucket, $key, $freezeAfterDays) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/restoreAr/' . $resource . '/freezeAfterDays/' . $freezeAfterDays; + return $this->rsPost($path); + } + + /** + * 修改文件的存储状态,即禁用状态和启用状态间的的互相转换 + * + * @param string $bucket 待操作资源所在空间 + * @param string $key 待操作资源文件名 + * @param int $status 0表示启用;1表示禁用 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/4173/modify-the-file-status + */ + public function changeStatus($bucket, $key, $status) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/chstatus/' . $resource . '/status/' . $status; + return $this->rsPost($path); + } + + /** + * 从指定URL抓取资源,并将该资源存储到指定空间中 + * + * @param string $url 指定的URL + * @param string $bucket 目标资源空间 + * @param string $key 目标资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1263/fetch + */ + public function fetch($url, $bucket, $key = null) + { + + $resource = \Qiniu\base64_urlSafeEncode($url); + $to = \Qiniu\entry($bucket, $key); + $path = '/fetch/' . $resource . '/to/' . $to; + + $ak = $this->auth->getAccessKey(); + try { + $ioHost = $this->config->getIovipHost($ak, $bucket); + } catch (\Exception $err) { + return array(null, $err); + } + + $url = $ioHost . $path; + return $this->postV2($url, null); + } + + /** + * 从指定URL异步抓取资源,并将该资源存储到指定空间中 + * + * @param string $url 需要抓取的url + * @param string $bucket 所在区域的bucket + * @param string $host 从指定url下载数据时使用的Host + * @param string $key 文件存储的key + * @param string $md5 文件md5 + * @param string $etag 文件etag + * @param string $callbackurl 回调URL + * @param string $callbackbody 回调Body + * @param string $callbackbodytype 回调Body内容类型,默认为"application/x-www-form-urlencoded" + * @param string $callbackhost 回调时使用的Host + * @param int $file_type 存储文件类型 0:标准存储(默认),1:低频存储,2:归档存储 + * @param bool $ignore_same_key 如果空间中已经存在同名文件则放弃本次抓取 + * @return array + * @link https://developer.qiniu.com/kodo/api/4097/asynch-fetch + */ + public function asynchFetch( + $url, + $bucket, + $host = null, + $key = null, + $md5 = null, + $etag = null, + $callbackurl = null, + $callbackbody = null, + $callbackbodytype = 'application/x-www-form-urlencoded', + $callbackhost = null, + $file_type = 0, + $ignore_same_key = false + ) { + $path = '/sisyphus/fetch'; + + $params = array('url' => $url, 'bucket' => $bucket); + \Qiniu\setWithoutEmpty($params, 'host', $host); + \Qiniu\setWithoutEmpty($params, 'key', $key); + \Qiniu\setWithoutEmpty($params, 'md5', $md5); + \Qiniu\setWithoutEmpty($params, 'etag', $etag); + \Qiniu\setWithoutEmpty($params, 'callbackurl', $callbackurl); + \Qiniu\setWithoutEmpty($params, 'callbackbody', $callbackbody); + \Qiniu\setWithoutEmpty($params, 'callbackbodytype', $callbackbodytype); + \Qiniu\setWithoutEmpty($params, 'callbackhost', $callbackhost); + \Qiniu\setWithoutEmpty($params, 'file_type', $file_type); + \Qiniu\setWithoutEmpty($params, 'ignore_same_key', $ignore_same_key); + $data = json_encode($params); + + $ak = $this->auth->getAccessKey(); + try { + $apiHost = $this->config->getApiHost($ak, $bucket); + } catch (\Exception $err) { + return array(null, $err); + } + $url = $apiHost . $path; + + return $this->postV2($url, $data); + } + + + /** + * 查询异步第三方资源抓取任务状态 + * + * @param string $zone + * @param string $id + * @return array + * @link https://developer.qiniu.com/kodo/api/4097/asynch-fetch + */ + public function asynchFetchStatus($zone, $id) + { + $scheme = "http://"; + + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + + $url = $scheme . "api-" . $zone . ".qiniu.com/sisyphus/fetch?id=" . $id; + + list($ret, $err) = $this->getV2($url); + + if ($err != null) { + return array(null, $err); + } + return array($ret, null); + } + + + /** + * 从镜像源站抓取资源到空间中,如果空间中已经存在,则覆盖该资源 + * + * @param string $bucket 待获取资源所在的空间 + * @param string $key 代获取资源文件名 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/1293/prefetch + */ + public function prefetch($bucket, $key) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/prefetch/' . $resource; + + $ak = $this->auth->getAccessKey(); + try { + $ioHost = $this->config->getIovipHost($ak, $bucket); + } catch (\Exception $err) { + return array(null, $err); + } + + $url = $ioHost . $path; + return $this->postV2($url, null); + } + + /** + * 在单次请求中进行多个资源管理操作 + * + * @param array $operations 资源管理操作数组 + * + * @return array 每个资源的处理情况,结果类似: + * [ + * { "code" => , "data" => }, + * { "code" => }, + * { "code" => }, + * { "code" => }, + * { "code" => , "data" => { "error": "" } }, + * ... + * ] + * @link http://developer.qiniu.com/docs/v6/api/reference/rs/batch.html + */ + public function batch($operations) + { + $params = 'op=' . implode('&op=', $operations); + return $this->rsPost('/batch', $params); + } + + /** + * 设置文件的生命周期 + * + * @param string $bucket 设置文件生命周期文件所在的空间 + * @param string $key 设置文件生命周期文件的文件名 + * @param int $days 设置该文件多少天后删除,当$days设置为0时表示取消该文件的生命周期 + * + * @return array + * @link https://developer.qiniu.com/kodo/api/update-file-lifecycle + */ + public function deleteAfterDays($bucket, $key, $days) + { + $entry = \Qiniu\entry($bucket, $key); + $path = "/deleteAfterDays/$entry/$days"; + return $this->rsPost($path); + } + + private function getRsfHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::RSF_HOST; + } + + private function getRsHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::RS_HOST; + } + + private function getApiHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::API_HOST; + } + + private function getUcHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS === true) { + $scheme = "https://"; + } + return $scheme . Config::UC_HOST; + } + + private function rsPost($path, $body = null) + { + $url = $this->getRsHost() . $path; + return $this->postV2($url, $body); + } + + private function apiPost($path, $body = null) + { + $url = $this->getApiHost() . $path; + return $this->postV2($url, $body); + } + + private function ucPost($path, $body = null) + { + $url = $this->getUcHost() . $path; + return $this->postV2($url, $body); + } + + private function ucGet($path) + { + $url = $this->getUcHost() . $path; + return $this->getV2($url); + } + + private function apiGet($path) + { + $url = $this->getApiHost() . $path; + return $this->getV2($url); + } + + private function rsGet($path) + { + $url = $this->getRsHost() . $path; + return $this->getV2($url); + } + + private function getV2($url) + { + $headers = $this->auth->authorizationV2($url, 'GET', null, 'application/x-www-form-urlencoded'); + $ret = Client::get($url, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function postV2($url, $body) + { + $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/x-www-form-urlencoded'); + $ret = Client::post($url, $body, $headers); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } + + public static function buildBatchCopy($source_bucket, $key_pairs, $target_bucket, $force) + { + return self::twoKeyBatch('/copy', $source_bucket, $key_pairs, $target_bucket, $force); + } + + + public static function buildBatchRename($bucket, $key_pairs, $force) + { + return self::buildBatchMove($bucket, $key_pairs, $bucket, $force); + } + + + public static function buildBatchMove($source_bucket, $key_pairs, $target_bucket, $force) + { + return self::twoKeyBatch('/move', $source_bucket, $key_pairs, $target_bucket, $force); + } + + + public static function buildBatchDelete($bucket, $keys) + { + return self::oneKeyBatch('/delete', $bucket, $keys); + } + + + public static function buildBatchStat($bucket, $keys) + { + return self::oneKeyBatch('/stat', $bucket, $keys); + } + + public static function buildBatchDeleteAfterDays($bucket, $key_day_pairs) + { + $data = array(); + foreach ($key_day_pairs as $key => $day) { + array_push($data, '/deleteAfterDays/' . \Qiniu\entry($bucket, $key) . '/' . $day); + } + return $data; + } + + public static function buildBatchChangeMime($bucket, $key_mime_pairs) + { + $data = array(); + foreach ($key_mime_pairs as $key => $mime) { + array_push($data, '/chgm/' . \Qiniu\entry($bucket, $key) . '/mime/' . base64_encode($mime)); + } + return $data; + } + + public static function buildBatchChangeType($bucket, $key_type_pairs) + { + $data = array(); + foreach ($key_type_pairs as $key => $type) { + array_push($data, '/chtype/' . \Qiniu\entry($bucket, $key) . '/type/' . $type); + } + return $data; + } + + public static function buildBatchRestoreAr($bucket, $key_restore_days_pairs) + { + $data = array(); + foreach ($key_restore_days_pairs as $key => $restore_days) { + array_push($data, '/restoreAr/' . \Qiniu\entry($bucket, $key) . '/freezeAfterDays/' . $restore_days); + } + return $data; + } + + private static function oneKeyBatch($operation, $bucket, $keys) + { + $data = array(); + foreach ($keys as $key) { + array_push($data, $operation . '/' . \Qiniu\entry($bucket, $key)); + } + return $data; + } + + private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket, $force) + { + if ($target_bucket === null) { + $target_bucket = $source_bucket; + } + $data = array(); + $forceOp = "false"; + if ($force) { + $forceOp = "true"; + } + foreach ($key_pairs as $from_key => $to_key) { + $from = \Qiniu\entry($source_bucket, $from_key); + $to = \Qiniu\entry($target_bucket, $to_key); + array_push($data, $operation . '/' . $from . '/' . $to . "/force/" . $forceOp); + } + return $data; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php new file mode 100644 index 0000000..453cc38 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php @@ -0,0 +1,149 @@ + "", + * "key" => "" + * ] + */ + public static function put( + $upToken, + $key, + $data, + $config, + $params, + $mime, + $fname + ) { + $fields = array('token' => $upToken); + if ($key === null) { + } else { + $fields['key'] = $key; + } + + //enable crc32 check by default + $fields['crc32'] = \Qiniu\crc32_data($data); + + if ($params) { + foreach ($params as $k => $v) { + $fields[$k] = $v; + } + } + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + if ($err != null) { + return array(null, $err); + } + + try { + $upHost = $config->getUpHost($accessKey, $bucket); + } catch (\Exception $err) { + return array(null, $err); + } + + $response = Client::multipartPost($upHost, $fields, 'file', $fname, $data, $mime); + if (!$response->ok()) { + return array(null, new Error($upHost, $response)); + } + return array($response->json(), null); + } + + /** + * 上传文件到七牛,内部使用 + * + * @param string $upToken 上传凭证 + * @param string $key 上传文件名 + * @param string $filePath 上传文件的路径 + * @param Config $config 上传配置 + * @param string $params 自定义变量,规格参考 + * https://developer.qiniu.com/kodo/manual/1235/vars#xvar + * @param string $mime 上传数据的mimeType + * + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + */ + public static function putFile( + $upToken, + $key, + $filePath, + $config, + $params, + $mime + ) { + + + $fields = array('token' => $upToken, 'file' => self::createFile($filePath, $mime)); + if ($key !== null) { + $fields['key'] = $key; + } + + $fields['crc32'] = \Qiniu\crc32_file($filePath); + + if ($params) { + foreach ($params as $k => $v) { + $fields[$k] = $v; + } + } + $fields['key'] = $key; + $headers = array('Content-Type' => 'multipart/form-data'); + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + if ($err != null) { + return array(null, $err); + } + + try { + $upHost = $config->getUpHost($accessKey, $bucket); + } catch (\Exception $err) { + return array(null, $err); + } + + $response = Client::post($upHost, $fields, $headers); + if (!$response->ok()) { + return array(null, new Error($upHost, $response)); + } + return array($response->json(), null); + } + + private static function createFile($filename, $mime) + { + // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax + // See: https://wiki.php.net/rfc/curl-file-upload + if (function_exists('curl_file_create')) { + return curl_file_create($filename, $mime); + } + + // Use the old style if using an older version of PHP + $value = "@{$filename}"; + if (!empty($mime)) { + $value .= ';type=' . $mime; + } + + return $value; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php new file mode 100644 index 0000000..eedc9af --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php @@ -0,0 +1,422 @@ +upToken = $upToken; + $this->key = $key; + $this->inputStream = $inputStream; + $this->size = $size; + $this->params = $params; + $this->mime = $mime; + $this->contexts = array(); + $this->finishedEtags = array("etags"=>array(), "uploadId"=>"", "expiredAt"=>0, "uploaded"=>0); + $this->config = $config; + $this->resumeRecordFile = $resumeRecordFile ? $resumeRecordFile : null; + $this->partSize = $partSize ? $partSize : config::BLOCK_SIZE; + + try { + $this->version = SplitUploadVersion::from($version ? $version : 'v1'); + } catch (\Exception $e) { + throw new \Exception("only support v1/v2 now!", 0, $e); + } + + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken); + $this->bucket = $bucket; + if ($err != null) { + return array(null, $err); + } + + $upHost = $config->getUpHost($accessKey, $bucket); + if ($err != null) { + throw new \Exception($err->message(), 1); + } + $this->host = $upHost; + } + + /** + * 上传操作 + */ + public function upload($fname) + { + $uploaded = 0; + if ($this->version == SplitUploadVersion::V2) { + $partNumber = 1; + $encodedObjectName = $this->key? \Qiniu\base64_urlSafeEncode($this->key) : '~'; + }; + // get upload record from resumeRecordFile + if ($this->resumeRecordFile != null) { + $blkputRets = null; + if (file_exists($this->resumeRecordFile)) { + $stream = fopen($this->resumeRecordFile, 'r'); + if ($stream) { + $streamLen = filesize($this->resumeRecordFile); + if ($streamLen > 0) { + $contents = fread($stream, $streamLen); + fclose($stream); + if ($contents) { + $blkputRets = json_decode($contents, true); + if ($blkputRets === null) { + error_log("resumeFile contents decode error"); + } + } else { + error_log("read resumeFile failed"); + } + } else { + error_log("resumeFile is empty"); + } + } else { + error_log("resumeFile open failed"); + } + } else { + error_log("resumeFile not exists"); + } + + if ($blkputRets) { + if ($this->version == SplitUploadVersion::V1) { + if (isset($blkputRets['contexts']) && isset($blkputRets['uploaded']) && + is_array($blkputRets['contexts']) && is_int($blkputRets['uploaded'])) { + $this->contexts = $blkputRets['contexts']; + $uploaded = $blkputRets['uploaded']; + } + } elseif ($this->version == SplitUploadVersion::V2) { + if (isset($blkputRets["etags"]) && isset($blkputRets["uploadId"]) && + isset($blkputRets["expiredAt"]) && $blkputRets["expiredAt"] > time() + && $blkputRets["uploaded"] > 0 && is_array($blkputRets["etags"]) && + is_string($blkputRets["uploadId"]) && is_int($blkputRets["expiredAt"])) { + $this->finishedEtags['etags'] = $blkputRets["etags"]; + $this->finishedEtags["uploadId"] = $blkputRets["uploadId"]; + $this->finishedEtags["expiredAt"] = $blkputRets["expiredAt"]; + $this->finishedEtags["uploaded"] = $blkputRets["uploaded"]; + $uploaded = $blkputRets["uploaded"]; + $partNumber = count($this->finishedEtags["etags"]) + 1; + } else { + $this->makeInitReq($encodedObjectName); + } + } else { + throw new \Exception("only support v1/v2 now!"); + } + } else { + if ($this->version == SplitUploadVersion::V2) { + $this->makeInitReq($encodedObjectName); + } + } + } else { + // init a Multipart Upload task if choose v2 + if ($this->version == SplitUploadVersion::V2) { + $this->makeInitReq($encodedObjectName); + } + } + + while ($uploaded < $this->size) { + $blockSize = $this->blockSize($uploaded); + $data = fread($this->inputStream, $blockSize); + if ($data === false) { + throw new \Exception("file read failed", 1); + } + if ($this->version == SplitUploadVersion::V1) { + $crc = \Qiniu\crc32_data($data); + $response = $this->makeBlock($data, $blockSize); + } elseif ($this->version == SplitUploadVersion::V2) { + $md5 = md5($data); + $response = $this->uploadPart( + $data, + $partNumber, + $this->finishedEtags["uploadId"], + $encodedObjectName, + $md5 + ); + } else { + throw new \Exception("only support v1/v2 now!"); + } + + $ret = null; + if ($response->ok() && $response->json() != null) { + $ret = $response->json(); + } + if ($response->statusCode < 0) { + list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($this->upToken); + if ($err != null) { + return array(null, $err); + } + $upHostBackup = $this->config->getUpBackupHost($accessKey, $bucket); + $this->host = $upHostBackup; + } + + if ($this->version == SplitUploadVersion::V1) { + if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) { + $response = $this->makeBlock($data, $blockSize); + $ret = $response->json(); + } + + if (!$response->ok() || !isset($ret['crc32']) || $crc != $ret['crc32']) { + return array(null, new Error($this->currentUrl, $response)); + } + array_push($this->contexts, $ret['ctx']); + } elseif ($this->version == SplitUploadVersion::V2) { + if ($response->needRetry() || !isset($ret['md5']) || $md5 != $ret['md5']) { + $response = $this->uploadPart( + $data, + $partNumber, + $this->finishedEtags["uploadId"], + $encodedObjectName, + $md5 + ); + $ret = $response->json(); + } + + if (!$response->ok() || !isset($ret['md5']) || $md5 != $ret['md5']) { + return array(null, new Error($this->currentUrl, $response)); + } + $blockStatus = array('etag' => $ret['etag'], 'partNumber' => $partNumber); + array_push($this->finishedEtags['etags'], $blockStatus); + $partNumber += 1; + } else { + throw new \Exception("only support v1/v2 now!"); + } + + $uploaded += $blockSize; + if ($this->version == SplitUploadVersion::V2) { + $this->finishedEtags['uploaded'] = $uploaded; + } + + if ($this->resumeRecordFile !== null) { + if ($this->version == SplitUploadVersion::V1) { + $recordData = array( + 'contexts' => $this->contexts, + 'uploaded' => $uploaded + ); + $recordData = json_encode($recordData); + } elseif ($this->version == SplitUploadVersion::V2) { + $recordData = json_encode($this->finishedEtags); + } else { + throw new \Exception("only support v1/v2 now!"); + } + if ($recordData) { + $isWritten = file_put_contents($this->resumeRecordFile, $recordData); + if ($isWritten === false) { + error_log("write resumeRecordFile failed"); + } + } else { + error_log('resumeRecordData encode failed'); + } + } + } + if ($this->version == SplitUploadVersion::V1) { + return $this->makeFile($fname); + } elseif ($this->version == SplitUploadVersion::V2) { + return $this->completeParts($fname, $this->finishedEtags['uploadId'], $encodedObjectName); + } else { + throw new \Exception("only support v1/v2 now!"); + } + } + + /** + * 创建块 + */ + private function makeBlock($block, $blockSize) + { + $url = $this->host . '/mkblk/' . $blockSize; + return $this->post($url, $block); + } + + private function fileUrl($fname) + { + $url = $this->host . '/mkfile/' . $this->size; + $url .= '/mimeType/' . \Qiniu\base64_urlSafeEncode($this->mime); + if ($this->key != null) { + $url .= '/key/' . \Qiniu\base64_urlSafeEncode($this->key); + } + $url .= '/fname/' . \Qiniu\base64_urlSafeEncode($fname); + if (!empty($this->params)) { + foreach ($this->params as $key => $value) { + $val = \Qiniu\base64_urlSafeEncode($value); + $url .= "/$key/$val"; + } + } + return $url; + } + + /** + * 创建文件 + */ + private function makeFile($fname) + { + $url = $this->fileUrl($fname); + $body = implode(',', $this->contexts); + $response = $this->post($url, $body); + if ($response->needRetry()) { + $response = $this->post($url, $body); + } + if (!$response->ok()) { + return array(null, new Error($this->currentUrl, $response)); + } + return array($response->json(), null); + } + + private function post($url, $data) + { + $this->currentUrl = $url; + $headers = array('Authorization' => 'UpToken ' . $this->upToken); + return Client::post($url, $data, $headers); + } + + private function blockSize($uploaded) + { + if ($this->size < $uploaded + $this->partSize) { + return $this->size - $uploaded; + } + return $this->partSize; + } + + private function makeInitReq($encodedObjectName) + { + $res = $this->initReq($encodedObjectName); + $this->finishedEtags["uploadId"] = $res['uploadId']; + $this->finishedEtags["expiredAt"] = $res['expireAt']; + } + + /** + * 初始化上传任务 + */ + private function initReq($encodedObjectName) + { + $url = $this->host.'/buckets/'.$this->bucket.'/objects/'.$encodedObjectName.'/uploads'; + $headers = array( + 'Authorization' => 'UpToken ' . $this->upToken, + 'Content-Type' => 'application/json' + ); + $response = $this->postWithHeaders($url, null, $headers); + return $response->json(); + } + + /** + * 分块上传v2 + */ + private function uploadPart($block, $partNumber, $uploadId, $encodedObjectName, $md5) + { + $headers = array( + 'Authorization' => 'UpToken ' . $this->upToken, + 'Content-Type' => 'application/octet-stream', + 'Content-MD5' => $md5 + ); + $url = $this->host.'/buckets/'.$this->bucket.'/objects/'.$encodedObjectName. + '/uploads/'.$uploadId.'/'.$partNumber; + $response = $this->put($url, $block, $headers); + return $response; + } + + private function completeParts($fname, $uploadId, $encodedObjectName) + { + $headers = array( + 'Authorization' => 'UpToken '.$this->upToken, + 'Content-Type' => 'application/json' + ); + $etags = $this->finishedEtags['etags']; + $sortedEtags = \Qiniu\arraySort($etags, 'partNumber'); + $metadata = array(); + $customVars = array(); + if ($this->params) { + foreach ($this->params as $k => $v) { + if (strpos($k, 'x:') === 0) { + $customVars[$k] = $v; + } elseif (strpos($k, 'x-qn-meta-') === 0) { + $metadata[$k] = $v; + } + } + } + if (empty($metadata)) { + $metadata = null; + } + if (empty($customVars)) { + $customVars = null; + } + $body = array( + 'fname' => $fname, + 'mimeType' => $this->mime, + 'metadata' => $metadata, + 'customVars' => $customVars, + 'parts' => $sortedEtags + ); + $jsonBody = json_encode($body); + $url = $this->host.'/buckets/'.$this->bucket.'/objects/'.$encodedObjectName.'/uploads/'.$uploadId; + $response = $this->postWithHeaders($url, $jsonBody, $headers); + if ($response->needRetry()) { + $response = $this->postWithHeaders($url, $jsonBody, $headers); + } + if (!$response->ok()) { + return array(null, new Error($this->currentUrl, $response)); + } + return array($response->json(), null); + } + + private function put($url, $data, $headers) + { + $this->currentUrl = $url; + return Client::put($url, $data, $headers); + } + + private function postWithHeaders($url, $data, $headers) + { + $this->currentUrl = $url; + return Client::post($url, $data, $headers); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php new file mode 100644 index 0000000..abadeb6 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php @@ -0,0 +1,154 @@ +config = $config; + } + + /** + * 上传二进制流到七牛 + * + * @param $upToken 上传凭证 + * @param $key 上传文件名 + * @param $data 上传二进制流 + * @param $params 自定义变量,规格参考 + * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar + * @param $mime 上传数据的mimeType + * @param $checkCrc 是否校验crc32 + * + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + */ + public function put( + $upToken, + $key, + $data, + $params = null, + $mime = 'application/octet-stream', + $fname = "default_filename" + ) { + + $params = self::trimParams($params); + return FormUploader::put( + $upToken, + $key, + $data, + $this->config, + $params, + $mime, + $fname + ); + } + + + /** + * 上传文件到七牛 + * + * @param string $upToken 上传凭证 + * @param string $key 上传文件名 + * @param string $filePath 上传文件的路径 + * @param array $params 定义变量,规格参考 + * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar + * @param boolean $mime 上传数据的mimeType + * @param string $checkCrc 是否校验crc32 + * @param string $resumeRecordFile 断点续传文件路径 默认为null + * @param string $version 分片上传版本 目前支持v1/v2版本 默认v1 + * @param int $partSize 分片上传v2字段 默认大小为4MB 分片大小范围为1 MB - 1 GB + * + * @return array 包含已上传文件的信息,类似: + * [ + * "hash" => "", + * "key" => "" + * ] + * @throws \Exception + */ + public function putFile( + $upToken, + $key, + $filePath, + $params = null, + $mime = 'application/octet-stream', + $checkCrc = false, + $resumeRecordFile = null, + $version = 'v1', + $partSize = config::BLOCK_SIZE + ) { + + $file = fopen($filePath, 'rb'); + if ($file === false) { + throw new \Exception("file can not open", 1); + } + $params = self::trimParams($params); + $stat = fstat($file); + $size = $stat['size']; + if ($size <= Config::BLOCK_SIZE) { + $data = fread($file, $size); + fclose($file); + if ($data === false) { + throw new \Exception("file can not read", 1); + } + return FormUploader::put( + $upToken, + $key, + $data, + $this->config, + $params, + $mime, + basename($filePath) + ); + } + + $up = new ResumeUploader( + $upToken, + $key, + $file, + $size, + $params, + $mime, + $this->config, + $resumeRecordFile, + $version, + $partSize + ); + $ret = $up->upload(basename($filePath)); + fclose($file); + return $ret; + } + + public static function trimParams($params) + { + if ($params === null) { + return null; + } + $ret = array(); + foreach ($params as $k => $v) { + $pos1 = strpos($k, 'x:'); + $pos2 = strpos($k, 'x-qn-meta-'); + if (($pos1 === 0 || $pos2 === 0) && !empty($v)) { + $ret[$k] = $v; + } + } + return $ret; + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Zone.php b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php new file mode 100644 index 0000000..7af0e3f --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php @@ -0,0 +1,47 @@ + $v) { + $keysValue[$k] = $v[$key]; + } + array_multisort($keysValue, $sort, $array); + return $array; + } + + /** + * Wrapper for JSON decode that implements error detection with helpful + * error messages. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * + * @return mixed + * @throws \InvalidArgumentException if the JSON cannot be parsed. + * @link http://www.php.net/manual/en/function.json-decode.php + */ + function json_decode($json, $assoc = false, $depth = 512) + { + static $jsonErrors = array( + JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch', + JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found', + JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded' + ); + + if (empty($json)) { + return null; + } + $data = \json_decode($json, $assoc, $depth); + + if (JSON_ERROR_NONE !== json_last_error()) { + $last = json_last_error(); + throw new \InvalidArgumentException( + 'Unable to parse JSON data: ' + . (isset($jsonErrors[$last]) + ? $jsonErrors[$last] + : 'Unknown error') + ); + } + + return $data; + } + + /** + * 计算七牛API中的数据格式 + * + * @param string $bucket 待操作的空间名 + * @param string $key 待操作的文件名 + * + * @return string 符合七牛API规格的数据格式 + * @link http://developer.qiniu.com/docs/v6/api/reference/data-formats.html + */ + function entry($bucket, $key) + { + $en = $bucket; + if (!empty($key)) { + $en = $bucket . ':' . $key; + } + return base64_urlSafeEncode($en); + } + + /** + * array 辅助方法,无值时不set + * + * @param array $array 待操作array + * @param string $key key + * @param string $value value 为null时 不设置 + * + * @return array 原来的array,便于连续操作 + */ + function setWithoutEmpty(&$array, $key, $value) + { + if (!empty($value)) { + $array[$key] = $value; + } + return $array; + } + + /** + * 缩略图链接拼接 + * + * @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 + */ + function thumbnail( + $url, + $mode, + $width, + $height, + $format = null, + $quality = null, + $interlace = null, + $ignoreError = 1 + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'thumbnail'), func_get_args()); + } + + /** + * 图片水印 + * + * @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 + */ + function waterImg( + $url, + $image, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null, + $watermarkScale = null + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'waterImg'), func_get_args()); + } + + /** + * 文字水印 + * + * @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 + */ + function waterText( + $url, + $text, + $font = '黑体', + $fontSize = 0, + $fontColor = null, + $dissolve = 100, + $gravity = 'SouthEast', + $dx = null, + $dy = null + ) { + + static $imageUrlBuilder = null; + if (is_null($imageUrlBuilder)) { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder; + } + + return call_user_func_array(array($imageUrlBuilder, 'waterText'), func_get_args()); + } + + /** + * 从uptoken解析accessKey和bucket + * + * @param $upToken + * @return array(ak,bucket,err=null) + */ + function explodeUpToken($upToken) + { + $items = explode(':', $upToken); + if (count($items) != 3) { + return array(null, null, "invalid uptoken"); + } + $accessKey = $items[0]; + $putPolicy = json_decode(base64_urlSafeDecode($items[2])); + $scope = $putPolicy->scope; + $scopeItems = explode(':', $scope); + $bucket = $scopeItems[0]; + return array($accessKey, $bucket, null); + } +} diff --git a/vendor/qiniu/php-sdk/test-env.sh b/vendor/qiniu/php-sdk/test-env.sh new file mode 100644 index 0000000..eedf6b5 --- /dev/null +++ b/vendor/qiniu/php-sdk/test-env.sh @@ -0,0 +1,4 @@ +export QINIU_ACCESS_KEY=xxx +export QINIU_SECRET_KEY=xxx +export QINIU_TEST_BUCKET=phpsdk +export QINIU_TEST_DOMAIN=phpsdk.qiniudn.com \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php new file mode 100644 index 0000000..8c6c531 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/AuthTest.php @@ -0,0 +1,211 @@ +sign('test'); + $this->assertEquals('abcdefghklmnopq:mSNBTR7uS2crJsyFr2Amwv1LaYg=', $token); + } + + public function testSignWithData() + { + global $dummyAuth; + $token = $dummyAuth->signWithData('test'); + $this->assertEquals('abcdefghklmnopq:-jP8eEV9v48MkYiBGs81aDxl60E=:dGVzdA==', $token); + } + + public function testSignRequest() + { + global $dummyAuth; + $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', ''); + $this->assertEquals('abcdefghklmnopq:cFyRVoWrE3IugPIMP5YJFTO-O-Y=', $token); + $ctype = 'application/x-www-form-urlencoded'; + $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', $ctype); + $this->assertEquals($token, 'abcdefghklmnopq:svWRNcacOE-YMsc70nuIYdaa1e4='); + } + + public function testPrivateDownloadUrl() + { + global $dummyAuth; + $_SERVER['override_qiniu_auth_time'] = true; + $url = $dummyAuth->privateDownloadUrl('http://www.qiniu.com?go=1'); + $expect = 'http://www.qiniu.com?go=1&e=1234571490&token=abcdefghklmnopq:8vzBeLZ9W3E4kbBLFLW0Xe0u7v4='; + $this->assertEquals($expect, $url); + unset($_SERVER['override_qiniu_auth_time']); + } + + public function testUploadToken() + { + global $dummyAuth; + $_SERVER['override_qiniu_auth_time'] = true; + $token = $dummyAuth->uploadToken('1', '2', 3600, array('endUser' => 'y')); + // @codingStandardsIgnoreStart + $exp = 'abcdefghklmnopq:yyeexeUkPOROoTGvwBjJ0F0VLEo=:eyJlbmRVc2VyIjoieSIsInNjb3BlIjoiMToyIiwiZGVhZGxpbmUiOjEyMzQ1NzE0OTB9'; + // @codingStandardsIgnoreEnd + $this->assertEquals($exp, $token); + unset($_SERVER['override_qiniu_auth_time']); + } + + public function testVerifyCallback() + { + } + + public function testSignQiniuAuthorization() + { + $auth = new Auth("ak", "sk"); + + // --- + $url = ""; + $method = ""; + $headers = new Header(array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded"), + )); + $body = "{\"name\": \"test\"}"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:0i1vKClRDWFyNkcTFzwcE7PzX74=", $sign); + + // --- + $url = ""; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/json"), + )); + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:K1DI0goT05yhGizDFE5FiPJxAj4=", $sign); + + // --- + $url = ""; + $method = "GET"; + $headers = new Header(array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded"), + )); + $body = "{\"name\": \"test\"}"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:0i1vKClRDWFyNkcTFzwcE7PzX74=", $sign); + + // --- + $url = ""; + $method = "POST"; + $headers = new Header(array( + "Content-Type" => array("application/json"), + "X-Qiniu" => array("b"), + )); + $body = "{\"name\": \"test\"}"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:0ujEjW_vLRZxebsveBgqa3JyQ-w=", $sign); + + // --- + $url = "http://upload.qiniup.com"; + $method = ""; + $headers = new Header(array( + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + "Content-Type" => array("application/x-www-form-urlencoded"), + )); + $body = "{\"name\": \"test\"}"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:GShw5NitGmd5TLoo38nDkGUofRw=", $sign); + + // --- + $url = "http://upload.qiniup.com"; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/json"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + )); + $body = "{\"name\": \"test\"}"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:DhNA1UCaBqSHCsQjMOLRfVn63GQ=", $sign); + + // --- + $url = "http://upload.qiniup.com"; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + )); + $body = "name=test&language=go"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:KUAhrYh32P9bv0COD8ugZjDCmII=", $sign); + + // --- + $url = "http://upload.qiniup.com"; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/x-www"), + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + )); + $body = "name=test&language=go"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:KUAhrYh32P9bv0COD8ugZjDCmII=", $sign); + + // --- + $url = "http://upload.qiniup.com/mkfile/sdf.jpg"; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + )); + $body = "name=test&language=go"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:fkRck5_LeyfwdkyyLk-hyNwGKac=", $sign); + + $url = "http://upload.qiniup.com/mkfile/sdf.jpg?s=er3&df"; + $method = ""; + $headers = new Header(array( + "Content-Type" => array("application/x-www-form-urlencoded"), + "X-Qiniu-Bbb" => array("BBB", "AAA"), + "X-Qiniu-Aaa" => array("DDD", "CCC"), + "X-Qiniu-" => array("a"), + "X-Qiniu" => array("b"), + )); + $body = "name=test&language=go"; + list($sign, $err) = $auth->signQiniuAuthorization($url, $method, $body, $headers); + $this->assertNull($err); + $this->assertEquals("ak:PUFPWsEUIpk_dzUvvxTTmwhp3p4=", $sign); + } + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php new file mode 100644 index 0000000..6d63353 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Base64Test.php @@ -0,0 +1,14 @@ +assertEquals($a, \Qiniu\base64_urlSafeDecode($b)); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php new file mode 100644 index 0000000..3fd51bb --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/BucketTest.php @@ -0,0 +1,598 @@ +bucketName = $bucketName; + $this->key = $key; + $this->key2 = $key2; + + global $customCallbackURL; + $this->customCallbackURL = $customCallbackURL; + + global $testAuth; + $config = new Config(); + $this->bucketManager = new BucketManager($testAuth, $config); + + global $dummyAuth; + $this->dummyBucketManager = new BucketManager($dummyAuth); + } + + public function testBuckets() + { + + list($list, $error) = $this->bucketManager->buckets(); + $this->assertNull($error); + $this->assertTrue(in_array($this->bucketName, $list)); + + list($list2, $error) = $this->dummyBucketManager->buckets(); + $this->assertEquals(401, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNotNull($error->getResponse()); + $this->assertNull($list2); + } + + public function testListbuckets() + { + list($ret, $error) = $this->bucketManager->listbuckets('z0'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testCreateBucket() + { + list($ret, $error) = $this->bucketManager->createBucket('phpsdk-ci-test'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDeleteBucket() + { + list($ret, $error) = $this->bucketManager->deleteBucket('phpsdk-ci-test'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDomains() + { + list($ret, $error) = $this->bucketManager->domains($this->bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketInfo() + { + list($ret, $error) = $this->bucketManager->bucketInfo($this->bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketInfos() + { + list($ret, $error) = $this->bucketManager->bucketInfos('z0'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testList() + { + list($ret, $error) = $this->bucketManager->listFiles($this->bucketName, null, null, 10); + $this->assertNull($error); + $this->assertNotNull($ret['items'][0]); + $this->assertNotNull($ret['marker']); + } + + public function testListFilesv2() + { + list($ret, $error) = $this->bucketManager->listFilesv2($this->bucketName, null, null, 10); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testBucketLifecycleRule() + { + // delete + $this->bucketManager->deleteBucketLifecycleRule($this->bucketName, 'demo'); + + // add + list($ret, $error) = $this->bucketManager->bucketLifecycleRule( + $this->bucketName, + 'demo', + 'test', + 80, + 70, + 72, + 74 + ); + $this->assertNull($error); + $this->assertNotNull($ret); + + // get + list($ret, $error) = $this->bucketManager->getBucketLifecycleRules($this->bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + $rule = null; + foreach ($ret as $r) { + if ($r["name"] === "demo") { + $rule = $r; + break; + } + } + $this->assertNotNull($rule); + $this->assertEquals("test", $rule["prefix"]); + $this->assertEquals(80, $rule["delete_after_days"]); + $this->assertEquals(70, $rule["to_line_after_days"]); + $this->assertEquals(72, $rule["to_archive_after_days"]); + $this->assertEquals(74, $rule["to_deep_archive_after_days"]); + + // update + list($ret, $error) = $this->bucketManager->updateBucketLifecycleRule( + $this->bucketName, + 'demo', + 'testupdate', + 90, + 75, + 80, + 85 + ); + $this->assertNull($error); + $this->assertNotNull($ret); + + // get + list($ret, $error) = $this->bucketManager->getBucketLifecycleRules($this->bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + $rule = null; + foreach ($ret as $r) { + if ($r["name"] === "demo") { + $rule = $r; + break; + } + } + $this->assertNotNull($rule); + $this->assertEquals("testupdate", $rule["prefix"]); + $this->assertEquals(90, $rule["delete_after_days"]); + $this->assertEquals(75, $rule["to_line_after_days"]); + $this->assertEquals(80, $rule["to_archive_after_days"]); + $this->assertEquals(85, $rule["to_deep_archive_after_days"]); + + // delete + list($ret, $error) = $this->bucketManager->deleteBucketLifecycleRule($this->bucketName, 'demo'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testPutBucketEvent() + { + list($ret, $error) = $this->bucketManager->putBucketEvent( + $this->bucketName, + 'bucketevent', + 'test', + 'img', + array('copy'), + $this->customCallbackURL + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testUpdateBucketEvent() + { + list($ret, $error) = $this->bucketManager->updateBucketEvent( + $this->bucketName, + 'bucketevent', + 'test', + 'video', + array('copy'), + $this->customCallbackURL + ); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testGetBucketEvent() + { + list($ret, $error) = $this->bucketManager->getBucketEvents($this->bucketName); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testDeleteBucketEvent() + { + list($ret, $error) = $this->bucketManager->deleteBucketEvent($this->bucketName, 'bucketevent'); + $this->assertNull($error); + $this->assertNotNull($ret); + } + + public function testStat() + { + list($stat, $error) = $this->bucketManager->stat($this->bucketName, $this->key); + $this->assertNull($error); + $this->assertNotNull($stat); + $this->assertNotNull($stat['hash']); + + list($stat, $error) = $this->bucketManager->stat($this->bucketName, 'nofile'); + $this->assertEquals(612, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNull($stat); + + list($stat, $error) = $this->bucketManager->stat('nobucket', 'nofile'); + $this->assertEquals(631, $error->code()); + $this->assertNotNull($error->message()); + $this->assertNull($stat); + } + + public function testDelete() + { + list($ret, $error) = $this->bucketManager->delete($this->bucketName, 'del'); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + + public function testRename() + { + $key = 'renamefrom' . rand(); + $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key); + $key2 = 'renameto' . $key; + list($ret, $error) = $this->bucketManager->rename($this->bucketName, $key, $key2); + $this->assertNull($error); + list($ret, $error) = $this->bucketManager->delete($this->bucketName, $key2); + $this->assertNull($error); + } + + + public function testCopy() + { + $key = 'copyto' . rand(); + $this->bucketManager->delete($this->bucketName, $key); + + list($ret, $error) = $this->bucketManager->copy( + $this->bucketName, + $this->key, + $this->bucketName, + $key + ); + $this->assertNull($error); + + //test force copy + list($ret, $error) = $this->bucketManager->copy( + $this->bucketName, + $this->key2, + $this->bucketName, + $key, + true + ); + $this->assertNull($error); + + list($key2Stat,) = $this->bucketManager->stat($this->bucketName, $this->key2); + list($key2CopiedStat,) = $this->bucketManager->stat($this->bucketName, $key); + + $this->assertEquals($key2Stat['hash'], $key2CopiedStat['hash']); + + list($ret, $error) = $this->bucketManager->delete($this->bucketName, $key); + $this->assertNull($error); + } + + + public function testChangeMime() + { + list($ret, $error) = $this->bucketManager->changeMime( + $this->bucketName, + 'php-sdk.html', + 'text/html' + ); + $this->assertNull($error); + } + + public function testPrefetch() + { + list($ret, $error) = $this->bucketManager->prefetch( + $this->bucketName, + 'php-sdk.html' + ); + $this->assertNull($error); + } + + public function testPrefetchFailed() + { + list($ret, $error) = $this->bucketManager->prefetch( + 'fakebucket', + 'php-sdk.html' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + public function testFetch() + { + list($ret, $error) = $this->bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + $this->bucketName, + 'fetch.html' + ); + $this->assertNull($error); + $this->assertArrayHasKey('hash', $ret); + + list($ret, $error) = $this->bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + $this->bucketName, + '' + ); + $this->assertNull($error); + $this->assertArrayHasKey('key', $ret); + + list($ret, $error) = $this->bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + $this->bucketName + ); + $this->assertNull($error); + $this->assertArrayHasKey('key', $ret); + } + + public function testFetchFailed() + { + list($ret, $error) = $this->bucketManager->fetch( + 'http://developer.qiniu.com/docs/v6/sdk/php-sdk.html', + 'fakebucket' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + public function testAsynchFetch() + { + list($ret, $error) = $this->bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + $this->bucketName, + null, + 'qiniu.png' + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + + list($ret, $error) = $this->bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + $this->bucketName, + null, + '' + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + + list($ret, $error) = $this->bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + $this->bucketName + ); + $this->assertNull($error); + $this->assertArrayHasKey('id', $ret); + } + + public function testAsynchFetchFailed() + { + list($ret, $error) = $this->bucketManager->asynchFetch( + 'http://devtools.qiniu.com/qiniu.png', + 'fakebucket' + ); + $this->assertNotNull($error); + $this->assertNull($ret); + } + + + public function testBatchCopy() + { + $key = 'copyto' . rand(); + $ops = BucketManager::buildBatchCopy( + $this->bucketName, + array($this->key => $key), + $this->bucketName, + true + ); + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertEquals(200, $ret[0]['code']); + $ops = BucketManager::buildBatchDelete($this->bucketName, array($key)); + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertEquals(200, $ret[0]['code']); + } + + public function testBatchMove() + { + $key = 'movefrom' . rand(); + $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key); + $key2 = $key . 'to'; + $ops = BucketManager::buildBatchMove( + $this->bucketName, + array($key => $key2), + $this->bucketName, + true + ); + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertEquals(200, $ret[0]['code']); + list($ret, $error) = $this->bucketManager->delete($this->bucketName, $key2); + $this->assertNull($error); + } + + public function testBatchRename() + { + $key = 'rename' . rand(); + $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key); + $key2 = $key . 'to'; + $ops = BucketManager::buildBatchRename($this->bucketName, array($key => $key2), true); + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertEquals(200, $ret[0]['code']); + list($ret, $error) = $this->bucketManager->delete($this->bucketName, $key2); + $this->assertNull($error); + } + + public function testBatchStat() + { + $ops = BucketManager::buildBatchStat($this->bucketName, array('php-sdk.html')); + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertEquals(200, $ret[0]['code']); + } + + public function testBatchChangeTypeAndBatchRestoreAr() + { + $key = 'toChangeTypeThenRestore' . rand(); + $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key); + + $ops = BucketManager::buildBatchChangeType($this->bucketName, array($key => 2)); // 2 Archive + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + + $ops = BucketManager::buildBatchRestoreAr($this->bucketName, array($key => 1)); // 1 day + list($ret, $error) = $this->bucketManager->batch($ops); + $this->assertNull($error); + $this->assertEquals(200, $ret[0]['code']); + + $this->bucketManager->delete($this->bucketName, $key); + } + + public function testDeleteAfterDays() + { + $key = rand(); + list($ret, $error) = $this->bucketManager->deleteAfterDays($this->bucketName, $key, 1); + $this->assertNotNull($error); + + $this->bucketManager->copy($this->bucketName, $this->key, $this->bucketName, $key); + list($ret, $error) = $this->bucketManager->deleteAfterDays($this->bucketName, $key, 1); + $this->assertEquals(null, $ret); + } + + public function testGetCorsRules() + { + list($ret, $err) = $this->bucketManager->getCorsRules($this->bucketName); + $this->assertNull($err); + } + + public function testPutBucketAccessStyleMode() + { + list($ret, $err) = $this->bucketManager->putBucketAccessStyleMode($this->bucketName, 0); + $this->assertNull($err); + } + + public function testPutBucketAccessMode() + { + list($ret, $err) = $this->bucketManager->putBucketAccessMode($this->bucketName, 0); + $this->assertNull($err); + } + + public function testPutReferAntiLeech() + { + list($ret, $err) = $this->bucketManager->putReferAntiLeech($this->bucketName, 0, "1", "*"); + $this->assertNull($err); + } + + public function testPutBucketMaxAge() + { + list($ret, $err) = $this->bucketManager->putBucketMaxAge($this->bucketName, 31536000); + $this->assertNull($err); + } + + public function testPutBucketQuota() + { + list($ret, $err) = $this->bucketManager->putBucketQuota($this->bucketName, -1, -1); + $this->assertNull($err); + } + + public function testGetBucketQuota() + { + list($ret, $err) = $this->bucketManager->getBucketQuota($this->bucketName); + $this->assertNull($err); + } + + public function testChangeType() + { + list($ret, $err) = $this->bucketManager->changeType($this->bucketName, $this->key, 0); + $this->assertNull($err); + + list($ret, $err) = $this->bucketManager->changeType($this->bucketName, $this->key, 1); + $this->assertNull($err); + } + + public function testArchiveRestoreAr() + { + $key = 'archiveToRestore' . rand(); + $this->bucketManager->delete($this->bucketName, $key); + + $this->bucketManager->copy( + $this->bucketName, + $this->key, + $this->bucketName, + $key + ); + $this->bucketManager->changeType($this->bucketName, $key, 2); + + list(, $err) = $this->bucketManager->restoreAr($this->bucketName, $key, 2); + $this->assertNull($err); + list($ret, $err) = $this->bucketManager->stat($this->bucketName, $key); + $this->assertNull($err); + + $this->assertEquals(2, $ret["type"]); + + // restoreStatus + // null means frozen; + // 1 means be unfreezing; + // 2 means be unfrozen; + $this->assertNotNull($ret["restoreStatus"]); + $this->assertContains($ret["restoreStatus"], array(1, 2)); + + $this->bucketManager->delete($this->bucketName, $key); + } + + public function testDeepArchiveRestoreAr() + { + $key = 'deepArchiveToRestore' . rand(); + $this->bucketManager->delete($this->bucketName, $key); + + $this->bucketManager->copy( + $this->bucketName, + $this->key, + $this->bucketName, + $key + ); + $this->bucketManager->changeType($this->bucketName, $key, 3); + + list(, $err) = $this->bucketManager->restoreAr($this->bucketName, $key, 1); + $this->assertNull($err); + list($ret, $err) = $this->bucketManager->stat($this->bucketName, $key); + $this->assertNull($err); + + $this->assertEquals(3, $ret["type"]); + + // restoreStatus + // null means frozen; + // 1 means be unfreezing; + // 2 means be unfrozen; + $this->assertNotNull($ret["restoreStatus"]); + $this->assertContains($ret["restoreStatus"], array(1, 2)); + + $this->bucketManager->delete($this->bucketName, $key); + } + + public function testChangeStatus() + { + list($ret, $err) = $this->bucketManager->changeStatus($this->bucketName, $this->key, 1); + $this->assertNull($err); + + list($ret, $err) = $this->bucketManager->changeStatus($this->bucketName, $this->key, 0); + $this->assertNull($err); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php new file mode 100644 index 0000000..2994e83 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/CdnManagerTest.php @@ -0,0 +1,146 @@ +cdnManager = new CdnManager($testAuth); + + global $timestampAntiLeechEncryptKey; + $this->encryptKey = $timestampAntiLeechEncryptKey; + + global $testStartDate; + $this->testStartDate = $testStartDate; + + global $testEndDate; + $this->testEndDate = $testEndDate; + + global $testGranularity; + $this->testGranularity = $testGranularity; + + global $testLogDate; + $this->testLogDate = $testLogDate; + + global $customDomain; + $this->refreshUrl = $customDomain . '/sdktest.png'; + $this->refreshDirs = $customDomain; + $this->customDomain = $customDomain; + + global $customDomain2; + $this->customDomain2 = $customDomain2; + } + + public function testRefreshUrls() + { + list($ret, $err) = $this->cdnManager->refreshUrls(array($this->refreshUrl)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testRefreshDirs() + { + list($ret, $err) = $this->cdnManager->refreshDirs(array($this->refreshDirs)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testRefreshUrlsAndDirs() + { + list($ret, $err) = $this->cdnManager->refreshUrlsAndDirs(array($this->refreshUrl), array($this->refreshDirs)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnRefreshList() + { + list($ret, $err) = $this->cdnManager->getCdnRefreshList(null, null, null, 'success'); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testPrefetchUrls() + { + list($ret, $err) = $this->cdnManager->prefetchUrls(array($this->refreshUrl)); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnPrefetchList() + { + list($ret, $err) = $this->cdnManager->getCdnPrefetchList(null, null, 'success'); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetBandwidthData() + { + list($ret, $err) = $this->cdnManager->getBandwidthData( + array($this->customDomain2), + $this->testStartDate, + $this->testEndDate, + $this->testGranularity + ); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetFluxData() + { + list($ret, $err) = $this->cdnManager->getFluxData( + array($this->customDomain2), + $this->testStartDate, + $this->testEndDate, + $this->testGranularity + ); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testGetCdnLogList() + { + $domain = getenv('QINIU_TEST_DOMAIN'); + list($ret, $err) = $this->cdnManager->getCdnLogList(array($domain), $this->testLogDate); + $this->assertNull($err); + $this->assertNotNull($ret); + } + + public function testCreateTimestampAntiLeechUrl() + { + $signUrl = $this->cdnManager->createTimestampAntiLeechUrl($this->refreshUrl, $this->encryptKey, 3600); + $response = Client::get($signUrl); + $this->assertNull($response->error); + $this->assertEquals($response->statusCode, 200); + + $signUrl = $this->cdnManager->createTimestampAntiLeechUrl( + $this->refreshUrl . '?qiniu', + $this->encryptKey, + 3600 + ); + $response = Client::get($signUrl); + $this->assertNull($response->error); + $this->assertEquals($response->statusCode, 200); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php new file mode 100644 index 0000000..9f7a7ac --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ConfigTest.php @@ -0,0 +1,45 @@ +accessKey = $accessKey; + global $bucketName; + $this->bucketName = $bucketName; + } + + public function testGetApiHost() + { + $conf = new Config(); + $hasException = false; + $apiHost = ''; + try { + $apiHost = $conf->getApiHost($this->accessKey, $this->bucketName); + } catch (\Exception $e) { + $hasException = true; + } + $this->assertFalse($hasException); + $this->assertEquals('http://api.qiniu.com', $apiHost); + } + + public function testGetApiHostErrored() + { + $conf = new Config(); + $hasException = false; + try { + $conf->getApiHost($this->accessKey, "fakebucket"); + } catch (\Exception $e) { + $hasException = true; + } + $this->assertTrue($hasException); + } + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php new file mode 100644 index 0000000..bfb36da --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/Crc32Test.php @@ -0,0 +1,21 @@ +assertEquals('1352841281', $b); + } + + public function testFile() + { + $b = \Qiniu\crc32_file(__file__); + $c = \Qiniu\crc32_file(__file__); + $this->assertEquals($c, $b); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php new file mode 100644 index 0000000..5373ab3 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/DownloadTest.php @@ -0,0 +1,25 @@ +privateDownloadUrl($base_url); + $response = Client::get($private_url); + $this->assertEquals(200, $response->statusCode); + } + + public function testFop() + { + global $testAuth; + $base_url = 'http://sdk.peterpy.cn/gogopher.jpg?exif'; + $private_url = $testAuth->privateDownloadUrl($base_url); + $response = Client::get($private_url); + $this->assertEquals(200, $response->statusCode); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php new file mode 100644 index 0000000..b77e805 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/EtagTest.php @@ -0,0 +1,52 @@ +assertEquals('Fto5o-5ea0sNMlW_75VgGJCv2AcJ', $r); + $this->assertNull($error); + } + + public function testLess4M() + { + $file = qiniuTempFile(3 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('Fs5BpnAjRykYTg6o5E09cjuXrDkG', $r); + $this->assertNull($error); + } + + public function test4M() + { + $file = qiniuTempFile(4 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('FiuKULnybewpEnrfTmxjsxc-3dWp', $r); + $this->assertNull($error); + } + + public function testMore4M() + { + $file = qiniuTempFile(5 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('lhvyfIWMYFTq4s4alzlhXoAkqfVL', $r); + $this->assertNull($error); + } + + public function test8M() + { + $file = qiniuTempFile(8 * 1024 * 1024, false); + list($r, $error) = Etag::sum($file); + unlink($file); + $this->assertEquals('lmRm9ZfGZ86bnMys4wRTWtJj9ClG', $r); + $this->assertNull($error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php new file mode 100644 index 0000000..6cbdb7f --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FopTest.php @@ -0,0 +1,37 @@ +execute('gogopher.jpg', 'exif'); + $this->assertNull($error); + $this->assertNotNull($exif); + } + + public function testExifPrivate() + { + global $testAuth; + $fop = new Operation('private-res.qiniudn.com', $testAuth); + list($exif, $error) = $fop->execute('noexif.jpg', 'exif'); + $this->assertNotNull($error); + $this->assertNull($exif); + } + + public function testbuildUrl() + { + $fops = 'imageView2/2/h/200'; + $fop = new Operation('testres.qiniudn.com'); + $url = $fop->buildUrl('gogopher.jpg', $fops); + $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200'); + + $fops = array('imageView2/2/h/200', 'imageInfo'); + $url = $fop->buildUrl('gogopher.jpg', $fops); + $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200|imageInfo'); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php new file mode 100644 index 0000000..402cc39 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/FormUpTest.php @@ -0,0 +1,76 @@ +bucketName = $bucketName; + + global $testAuth; + $this->auth = $testAuth; + $this->cfg = new Config(); + } + + public function testData() + { + $token = $this->auth->uploadToken($this->bucketName); + list($ret, $error) = FormUploader::put($token, 'formput', 'hello world', $this->cfg, null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testData2() + { + $upManager = new UploadManager(); + $token = $this->auth->uploadToken($this->bucketName); + list($ret, $error) = $upManager->put($token, 'formput', 'hello world', null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testDataFailed() + { + $token = $this->auth->uploadToken('fakebucket'); + list($ret, $error) = FormUploader::put($token, 'formput', 'hello world', $this->cfg, null, 'text/plain', null); + $this->assertNull($ret); + $this->assertNotNull($error); + } + + public function testFile() + { + $key = 'formPutFile'; + $token = $this->auth->uploadToken($this->bucketName, $key); + list($ret, $error) = FormUploader::putFile($token, $key, __file__, $this->cfg, null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFile2() + { + $key = 'formPutFile'; + $token = $this->auth->uploadToken($this->bucketName, $key); + $upManager = new UploadManager(); + list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain', null); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + } + + public function testFileFailed() + { + $key = 'fakekey'; + $token = $this->auth->uploadToken('fakebucket', $key); + list($ret, $error) = FormUploader::putFile($token, $key, __file__, $this->cfg, null, 'text/plain', null); + $this->assertNull($ret); + $this->assertNotNull($error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php new file mode 100644 index 0000000..b7ecd1f --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HeaderTest.php @@ -0,0 +1,167 @@ + array('200'), + ':x-test-1' => array('hello1'), + ':x-Test-2' => array('hello2'), + 'content-type' => array('application/json'), + 'CONTENT-LENGTH' => array(1234), + 'oRiGin' => array('https://www.qiniu.com'), + 'ReFer' => array('www.qiniu.com'), + 'Last-Modified' => array('Mon, 06 Sep 2021 06:44:52 GMT'), + 'acCePt-ChArsEt' => array('utf-8'), + 'x-test-3' => array('hello3'), + 'cache-control' => array('no-cache', 'no-store'), + ); + + public function testNormalizeKey() + { + $except = array( + ':status', + ':x-test-1', + ':x-Test-2', + 'Content-Type', + 'Content-Length', + 'Origin', + 'Refer', + 'Last-Modified', + 'Accept-Charset', + 'X-Test-3', + 'Cache-Control' + ); + $actual = array_map(function ($str) { + return Header::normalizeKey($str); + }, array_keys($this->heads)); + $this->assertEquals($actual, $except); + } + + + public function testInvalidKeyName() + { + $except = array( + 'a:x-test-1', + ); + + $actual = array_map(function ($str) { + return Header::normalizeKey($str); + }, $except); + + $this->assertEquals($except, $actual); + } + + public function testGetRawData() + { + $header = new Header($this->heads); + foreach ($this->heads as $k => $v) { + $rawHeader = $header->getRawData(); + $this->assertEquals($v, $rawHeader[Header::normalizeKey($k)]); + } + } + + public function testOffsetExists() + { + $header = new Header($this->heads); + foreach (array_keys($this->heads) as $k) { + $this->assertNotNull($header[$k]); + } + + $except = array( + ':status', + ':x-test-1', + ':x-Test-2', + 'Content-Type', + 'Content-Length', + 'Origin', + 'Refer', + 'Last-Modified', + 'Accept-Charset', + 'X-Test-3', + 'Cache-Control' + ); + foreach ($except as $k) { + $this->assertNotNull($header[$k], $k." is null"); + } + } + + public function testOffsetGet() + { + $header = new Header($this->heads); + foreach ($this->heads as $k => $v) { + $this->assertEquals($v[0], $header[$k]); + } + + $this->assertNull($header['no-exist']); + } + + public function testOffsetSet() + { + $header = new Header($this->heads); + $header["X-Test-3"] = "hello"; + $this->assertEquals("hello", $header["X-Test-3"]); + $header["x-test-3"] = "hello test3"; + $this->assertEquals("hello test3", $header["x-test-3"]); + $header[":x-Test-2"] = "hello"; + $this->assertEquals("hello", $header[":x-Test-2"]); + $header[":x-test-2"] = "hello test2"; + $this->assertEquals("hello", $header[":x-Test-2"]); + } + + public function testOffsetUnset() + { + $header = new Header($this->heads); + unset($header["X-Test-3"]); + $this->assertFalse(isset($header["X-Test-3"])); + + $header = new Header($this->heads); + unset($header["x-test-3"]); + $this->assertFalse(isset($header["x-test-3"])); + + $header = new Header($this->heads); + unset($header[":x-test-2"]); + $this->assertTrue(isset($header[":x-Test-2"])); + + $header = new Header($this->heads); + unset($header[":x-Test-2"]); + $this->assertFalse(isset($header[":x-Test-2"])); + } + + public function testGetIterator() + { + $header = new Header($this->heads); + + $hasException = false; + try { + foreach ($header as $k => $v) { + $hasException = !isset($header[$k]); + } + } catch (\Exception $e) { + $hasException = true; + } + $this->assertFalse($hasException); + } + + public function testCount() + { + $header = new Header($this->heads); + + $this->assertEquals(count($this->heads), count($header)); + } + + public function testFromRaw() + { + $lines = array(); + foreach ($this->heads as $k => $vs) { + foreach ($vs as $v) { + array_push($lines, $k . ": " . $v); + } + } + $raw = implode("\r\n", $lines); + $headerFromRaw = Header::fromRawText($raw); + $this->assertEquals(new Header($this->heads), $headerFromRaw); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php new file mode 100644 index 0000000..558bc1f --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/HttpTest.php @@ -0,0 +1,79 @@ +assertEquals($response->statusCode, 200); + $this->assertNotNull($response->body); + $this->assertNull($response->error); + } + + public function testGetQiniu() + { + $response = Client::get('upload.qiniu.com'); + $this->assertEquals(405, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testDelete() + { + $response = Client::delete('uc.qbox.me/bucketTagging', array()); + $this->assertEquals($response->statusCode, 401); + $this->assertNotNull($response->body); + $this->assertNotNull($response->error); + } + + public function testDeleteQiniu() + { + $response = Client::delete('uc.qbox.me/bucketTagging', array()); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testPost() + { + $response = Client::post('qiniu.com', null); + $this->assertEquals($response->statusCode, 200); + $this->assertNotNull($response->body); + $this->assertNull($response->error); + } + + public function testPostQiniu() + { + $response = Client::post('upload.qiniu.com', null); + $this->assertEquals($response->statusCode, 400); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } + + public function testPut() + { + $response = Client::PUT('uc.qbox.me/bucketTagging', null); + $this->assertEquals($response->statusCode, 401); + $this->assertNotNull($response->body); + $this->assertNotNull($response->error); + } + + public function testPutQiniu() + { + $response = Client::put('uc.qbox.me/bucketTagging', null); + $this->assertEquals(401, $response->statusCode); + $this->assertNotNull($response->body); + $this->assertNotNull($response->xReqId()); + $this->assertNotNull($response->xLog()); + $this->assertNotNull($response->error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php new file mode 100644 index 0000000..fca87b6 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ImageUrlBuilderTest.php @@ -0,0 +1,261 @@ + + */ +class ImageUrlBuilderTest extends \PHPUnit_Framework_TestCase +{ + /** + * 缩略图测试 + * + * @test + * @return void + * @author Sherlock Ren + */ + public function testThumbutl() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?watermark/1/gravity/SouthEast/dx/0/dy/0/image/' + . 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB'; + // 异常测试 + $this->assertEquals($url, $imageUrlBuilder->thumbnail($url, 1, 0, 0)); + $this->assertEquals($url, \Qiniu\thumbnail($url, 1, 0, 0)); + + // 简单缩略测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200) + ); + + // 输出格式测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png') + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png') + ); + + // 渐进显示测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png', 1) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png', 2) + ); + + // 图片质量测试 + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/q/80/ignore-error/1/', + $imageUrlBuilder->thumbnail($url, 1, 200, 200, 'png', 1, 80) + ); + $this->assertEquals( + $url . '?imageView2/1/w/200/h/200/format/png/interlace/1/ignore-error/1/', + \Qiniu\thumbnail($url, 1, 200, 200, 'png', 1, 101) + ); + + // 多参数测试 + $this->assertEquals( + $url2 . '|imageView2/1/w/200/h/200/ignore-error/1/', + $imageUrlBuilder->thumbnail($url2, 1, 200, 200) + ); + $this->assertEquals( + $url2 . '|imageView2/1/w/200/h/200/ignore-error/1/', + \Qiniu\thumbnail($url2, 1, 200, 200) + ); + } + + /** + * 图片水印测试 + * + * @test + * @param void + * @return void + * @author Sherlock Ren + */ + public function waterImgTest() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/'; + $image = 'http://developer.qiniu.com/resource/logo-2.jpg'; + + // 水印简单测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url, $image) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url, $image, 101) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==/', + $imageUrlBuilder->waterImg($url, $image, 101, 'sdfsd') + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image) + ); + + // 横轴边距测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad') + ); + + // 纵轴边距测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/dy/10/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10, 10) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad', 'asdf') + ); + + // 自适应原图的短边比例测试 + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/dx/10/dy/10/ws/0.5/', + $imageUrlBuilder->waterImg($url, $image, 100, 'SouthEast', 10, 10, 0.5) + ); + $this->assertEquals( + $url . '?watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url, $image, 100, 'SouthEast', 'sad', 'asdf', 2) + ); + + // 多参数测试 + $this->assertEquals( + $url2 . '|watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterImg($url2, $image) + ); + $this->assertEquals( + $url2 . '|watermark/1/image/aHR0cDovL2RldmVsb3Blci5xaW5pdS5jb20vcmVzb3VyY2UvbG9nby0yLmpwZw==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterImg($url2, $image) + ); + } + + /** + * 文字水印测试 + * + * @test + * @param void + * @return void + * @author Sherlock Ren + */ + public function waterTextTest() + { + $imageUrlBuilder = new \Qiniu\Processing\ImageUrlBuilder(); + $url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; + $url2 = $url . '?imageView2/1/w/200/h/200/format/png/ignore-error/1/'; + $text = '测试一下'; + $font = '微软雅黑'; + $fontColor = '#FF0000'; + + // 水印简单测试 + $this->assertEquals($url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', $imageUrlBuilder->waterText($url, $text, $font, 500)); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf') + ); + + // 字体颜色测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/' + . 'I0ZGMDAwMA==/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==' + . '/dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor) + ); + + // 透明度测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/SouthEast/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==' + . '/gravity/SouthEast/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101) + ); + + // 水印位置测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East') + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf') + ); + + // 横轴距离测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/dx/10/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East', 10) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf', 'sdfs') + ); + + // 纵轴距离测试 + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGMDAwMA==' + . '/dissolve/80/gravity/East/dx/10/dy/10/', + $imageUrlBuilder->waterText($url, $text, $font, 500, $fontColor, 80, 'East', 10, 10) + ); + $this->assertEquals( + $url . '?watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/fill/I0ZGMDAwMA==/', + \Qiniu\waterText($url, $text, $font, 'sdf', $fontColor, 101, 'sdfsdf', 'sdfs', 'ssdf') + ); + // 多参数测试 + $this->assertEquals( + $url2 . '|watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', + $imageUrlBuilder->waterText($url2, $text, $font, 500) + ); + $this->assertEquals( + $url2 . '|watermark/2/text/5rWL6K-V5LiA5LiL/font/5b6u6L2v6ZuF6buR/' + . 'fontsize/500/dissolve/100/gravity/SouthEast/', + \Qiniu\waterText($url2, $text, $font, 500) + ); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php new file mode 100644 index 0000000..d03b3f6 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php @@ -0,0 +1,66 @@ +execute($bucket, $key, $fops); + $this->assertNull($error); + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } + + + public function testPfops() + { + global $testAuth; + $bucket = 'testres'; + $key = 'sintel_trailer.mp4'; + $fops = array( + 'avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240', + 'vframe/jpg/offset/7/w/480/h/360', + ); + $pfop = new PersistentFop($testAuth, null); + + list($id, $error) = $pfop->execute($bucket, $key, $fops); + $this->assertNull($error); + + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } + + public function testMkzip() + { + global $testAuth; + $bucket = 'phpsdk'; + $key = 'php-logo.png'; + $pfop = new PersistentFop($testAuth, null); + + $url1 = 'http://phpsdk.qiniudn.com/php-logo.png'; + $url2 = 'http://phpsdk.qiniudn.com/php-sdk.html'; + $zipKey = 'test.zip'; + + $fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1); + $fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2); + $fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey"); + + list($id, $error) = $pfop->execute($bucket, $key, $fops); + $this->assertNull($error); + + list($status, $error) = $pfop->status($id); + $this->assertNotNull($status); + $this->assertNull($error); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php new file mode 100644 index 0000000..989786a --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php @@ -0,0 +1,312 @@ +delete($bucketName, $key); + } + } + protected $bucketName; + protected $auth; + + protected function setUp() + { + global $bucketName; + $this->bucketName = $bucketName; + + global $testAuth; + $this->auth = $testAuth; + } + + public function test4ML() + { + $key = "resumePutFile4ML_".rand(); + $upManager = new UploadManager(); + $token = $this->auth->uploadToken($this->bucketName, $key); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + unlink($resumeFile); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + + public function test4ML2() + { + $key = 'resumePutFile4ML_'.rand(); + $zone = new Zone(array('upload.fake.qiniu.com'), array('upload.qiniup.com')); + $cfg = new Config($zone); + $upManager = new UploadManager($cfg); + $token = $this->auth->uploadToken($this->bucketName, $key); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + unlink($resumeFile); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + + // public function test8M() + // { + // $key = 'resumePutFile8M'; + // $upManager = new UploadManager(); + // $token = $this->auth->uploadToken($this->bucketName, $key); + // $tempFile = qiniuTempFile(8*1024*1024+10); + // list($ret, $error) = $upManager->putFile($token, $key, $tempFile); + // $this->assertNull($error); + // $this->assertNotNull($ret['hash']); + // unlink($tempFile); + // } + + public function testFileWithFileType() + { + $config = new Config(); + $bucketManager = new BucketManager($this->auth, $config); + + $testCases = array( + array( + "fileType" => 1, + "name" => "IA" + ), + array( + "fileType" => 2, + "name" => "Archive" + ), + array( + "fileType" => 3, + "name" => "DeepArchive" + ) + ); + + foreach ($testCases as $testCase) { + $key = 'FileType'.$testCase["name"].rand(); + $police = array( + "fileType" => $testCase["fileType"], + ); + $token = $this->auth->uploadToken($this->bucketName, $key, 3600, $police); + $upManager = new UploadManager(); + list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain'); + $this->assertNull($error); + $this->assertNotNull($ret); + array_push(self::$keyToDelete, $key); + list($ret, $err) = $bucketManager->stat($this->bucketName, $key); + $this->assertNull($err); + $this->assertEquals($testCase["fileType"], $ret["type"]); + } + } + + public function testResumeUploadWithParams() + { + $key = "resumePutFile4ML_".rand(); + $upManager = new UploadManager(); + $policy = array('returnBody' => '{"hash":$(etag),"fname":$(fname),"var_1":$(x:var_1),"var_2":$(x:var_2)}'); + $token = $this->auth->uploadToken($this->bucketName, $key, 3600, $policy); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + ["x:var_1" => "val_1", "x:var_2" => "val_2", "x-qn-meta-m1" => "val_1", "x-qn-meta-m2" => "val_2"], + 'application/octet-stream', + false, + $resumeFile + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + $this->assertEquals("val_1", $ret['var_1']); + $this->assertEquals("val_2", $ret['var_2']); + $this->assertEquals(basename($tempFile), $ret['fname']); + unlink($resumeFile); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + $this->assertEquals("val_1", $response->headers()["X-Qn-Meta-M1"]); + $this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]); + unlink($tempFile); + } + + public function testResumeUploadV2() + { + $zone = new Zone(array('up.qiniup.com')); + $cfg = new Config($zone); + $upManager = new UploadManager($cfg); + $testFileSize = array( + config::BLOCK_SIZE / 2, + config::BLOCK_SIZE, + config::BLOCK_SIZE + 10, + config::BLOCK_SIZE * 2, + config::BLOCK_SIZE * 2.5 + ); + $partSize = 5 * 1024 * 1024; + foreach ($testFileSize as $item) { + $key = 'resumePutFile4ML_'.rand()."_"; + $token = $this->auth->uploadToken($this->bucketName, $key); + $tempFile = qiniuTempFile($item); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile, + 'v2', + $partSize + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + unlink($resumeFile); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + unlink($tempFile); + } + } + + public function testResumeUploadV2WithParams() + { + $key = "resumePutFile4ML_".rand(); + $upManager = new UploadManager(); + $policy = array('returnBody' => '{"hash":$(etag),"fname":$(fname),"var_1":$(x:var_1),"var_2":$(x:var_2)}'); + $token = $this->auth->uploadToken($this->bucketName, $key, 3600, $policy); + $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + list($ret, $error) = $upManager->putFile( + $token, + $key, + $tempFile, + ["x:var_1" => "val_1", "x:var_2" => "val_2", "x-qn-meta-m1" => "val_1", "x-qn-meta-m2" => "val_2"], + 'application/octet-stream', + false, + $resumeFile, + 'v2' + ); + $this->assertNull($error); + $this->assertNotNull($ret['hash']); + $this->assertEquals("val_1", $ret['var_1']); + $this->assertEquals("val_2", $ret['var_2']); + $this->assertEquals(basename($tempFile), $ret['fname']); + unlink($resumeFile); + + $domain = getenv('QINIU_TEST_DOMAIN'); + $response = Client::get("http://$domain/$key"); + $this->assertEquals(200, $response->statusCode); + $this->assertEquals(md5_file($tempFile, true), md5($response->body(), true)); + $this->assertEquals("val_1", $response->headers()["X-Qn-Meta-M1"]); + $this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]); + unlink($tempFile); + } + + // valid versions are tested above + // Use PHPUnit's Data Provider to test multiple Exception is better, + // but not match the test style of this project + public function testResumeUploadWithInvalidVersion() + { + $zone = new Zone(array('up.qiniup.com')); + $cfg = new Config($zone); + $upManager = new UploadManager($cfg); + $testFileSize = config::BLOCK_SIZE * 2; + $partSize = 5 * 1024 * 1024; + $testInvalidVersions = array( + // High probability invalid versions + 'v', + '1', + '2' + ); + + $expectExceptionCount = 0; + foreach ($testInvalidVersions as $invalidVersion) { + $key = 'resumePutFile4ML_'.rand()."_"; + $token = $this->auth->uploadToken($this->bucketName, $key); + $tempFile = qiniuTempFile($testFileSize); + $resumeFile = tempnam(sys_get_temp_dir(), 'resume_file'); + $this->assertNotFalse($resumeFile); + try { + $upManager->putFile( + $token, + $key, + $tempFile, + null, + 'application/octet-stream', + false, + $resumeFile, + $invalidVersion, + $partSize + ); + } catch (\Exception $e) { + $isRightException = false; + $expectExceptionCount++; + while ($e) { + $isRightException = $e instanceof \UnexpectedValueException; + if ($isRightException) { + break; + } + $e = $e->getPrevious(); + } + $this->assertTrue($isRightException); + } + + unlink($resumeFile); + unlink($tempFile); + } + $this->assertEquals(count($testInvalidVersions), $expectExceptionCount); + } +} diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php new file mode 100644 index 0000000..cc5cce5 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ZoneTest.php @@ -0,0 +1,125 @@ +bucketName = $bucketName; + + global $bucketNameBC; + $this->bucketNameBC = $bucketNameBC; + + global $bucketNameNA; + $this->bucketNameNA = $bucketNameNA; + + global $bucketNameFS; + $this->bucketNameFS = $bucketNameFS; + + global $bucketNameAS; + $this->bucketNameAS = $bucketNameAS; + + global $accessKey; + $this->ak = $accessKey; + + $this->zone = new Zone(); + $this->zoneHttps = new Zone('https'); + } + + public function testUpHosts() + { + list($ret, $err) = Zone::queryZone($this->ak, 'fakebucket'); + $this->assertNull($ret); + $this->assertNotNull($err); + + $zone = Zone::queryZone($this->ak, $this->bucketName); + $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameBC); + $this->assertContains('upload-z1.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameFS); + $this->assertContains('upload-z2.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameNA); + $this->assertContains('upload-na0.qiniup.com', $zone->cdnUpHosts); + + $zone = Zone::queryZone($this->ak, $this->bucketNameAS); + $this->assertContains('upload-as0.qiniup.com', $zone->cdnUpHosts); + } + + public function testIoHosts() + { + $zone = Zone::queryZone($this->ak, $this->bucketName); + $this->assertEquals($zone->iovipHost, 'iovip.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameBC); + $this->assertEquals($zone->iovipHost, 'iovip-z1.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameFS); + $this->assertEquals($zone->iovipHost, 'iovip-z2.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameNA); + $this->assertEquals($zone->iovipHost, 'iovip-na0.qbox.me'); + + $zone = Zone::queryZone($this->ak, $this->bucketNameAS); + $this->assertEquals($zone->iovipHost, 'iovip-as0.qbox.me'); + } + + public function testZonez0() + { + $zone = Zone::zonez0(); + $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts); + } + + public function testZonez1() + { + $zone = Zone::zonez1(); + $this->assertContains('upload-z1.qiniup.com', $zone->cdnUpHosts); + } + + public function testZonez2() + { + $zone = Zone::zonez2(); + $this->assertContains('upload-z2.qiniup.com', $zone->cdnUpHosts); + } + + public function testZoneNa0() + { + $zone = Zone::zoneNa0(); + $this->assertContains('upload-na0.qiniup.com', $zone->cdnUpHosts); + } + + public function testZoneAs0() + { + $zone = Zone::zoneAs0(); + $this->assertContains('upload-as0.qiniup.com', $zone->cdnUpHosts); + } + + public function testQvmZonez0() + { + $zone = Zone::qvmZonez0(); + $this->assertContains('free-qvm-z0-xs.qiniup.com', $zone->srcUpHosts); + } + + public function testQvmZonez1() + { + $zone = Zone::qvmZonez1(); + $this->assertContains('free-qvm-z1-zz.qiniup.com', $zone->srcUpHosts); + } +} diff --git a/vendor/qiniu/php-sdk/tests/bootstrap.php b/vendor/qiniu/php-sdk/tests/bootstrap.php new file mode 100644 index 0000000..9859a81 --- /dev/null +++ b/vendor/qiniu/php-sdk/tests/bootstrap.php @@ -0,0 +1,61 @@ + 0) { + $length = min($rest_size, 4 * 1024); + if (fwrite($file, random_bytes($length)) == false) { + return false; + } + $rest_size -= $length; + } + } else if ($size > 0) { + fseek($file, $size - 1); + fwrite($file, ' '); + } + fclose($file); + return $fileName; +} diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 0000000..be5540c --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +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. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 0000000..9430d76 --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 0000000..de8ce62 --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 0000000..c7285a5 --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +}