From 0c84f99b1e952858a81395ed191767bdd8b74555 Mon Sep 17 00:00:00 2001 From: NoAccident Date: Fri, 2 Jun 2023 15:35:33 +0800 Subject: [PATCH] update 3.23.5 --- LICENSE | 18 ---- Obs/Internal/Resource/Constants.php | 21 +++- Obs/Internal/Resource/OBSRequestResource.php | 104 ++++++++++++++++++- Obs/Internal/Resource/V2RequestResource.php | 103 +++++++++++++++++- Obs/ObsClient.php | 2 +- README.md | 13 +++ composer.json | 7 +- 7 files changed, 242 insertions(+), 26 deletions(-) diff --git a/LICENSE b/LICENSE index dee493f..4cd54f9 100644 --- a/LICENSE +++ b/LICENSE @@ -199,21 +199,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - OPEN SOURCE SOFTWARE NOTICE - - This document contains open source software notice for this product. And this document is confidential information of copyright holder. Recipient shall protect it in due care and shall not disseminate it without permission. - - Warranty Disclaimer - - THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. - - Copyright Notice and License Texts - - Written Offer - - This product contains software whose rights holders license it on the terms of the GNU General Public License, version 2 (GPLv2) or other open source software license. We will provide you with the source code of the software licensed under related license if you send us a written request by mail or email to the following addresses: - foss@huawei.com - detailing the name of the product and the firmware version for which you need the source code and indicating how we can contact you. - - PLEASE NOTE THAT WE WILL ASK YOU TO PAY US FOR THE COSTS OF A DATA CARRIER AND THE POSTAL CHARGES TO SEND THE DATA CARRIER TO YOU. THIS OFFER IS VALID FOR THREE YEARS FROM THE MOMENT WE DISTRIBUTED THE PRODUCT AND VALID FOR AS LONG AS WE OFFER SPARE PARTS OR CUSTOMER SUPPORT FOR THAT PRODUCT MODEL. diff --git a/Obs/Internal/Resource/Constants.php b/Obs/Internal/Resource/Constants.php index 5f0753b..6f99d80 100644 --- a/Obs/Internal/Resource/Constants.php +++ b/Obs/Internal/Resource/Constants.php @@ -18,7 +18,7 @@ namespace Obs\Internal\Resource; class Constants { - const ALLOWED_RESOURCE_PARAMTER_NAMES = [ + const ALLOWED_RESOURCE_PARAMTER_NAMES = [ 'acl', 'policy', 'torrent', @@ -55,7 +55,24 @@ class Constants { 'replication', 'append', 'position', - 'x-oss-process' + 'x-oss-process', + + 'CDNNotifyConfiguration', + 'attname', + 'customdomain', + 'directcoldaccess', + 'encryption', + 'inventory', + 'length', + 'metadata', + 'modify', + 'name', + 'rename', + 'truncate', + 'x-image-save-bucket', + 'x-image-save-object', + 'x-obs-security-token', + 'x-obs-callback', ]; const ALLOWED_REQUEST_HTTP_HEADER_METADATA_NAMES = [ 'content-type', diff --git a/Obs/Internal/Resource/OBSRequestResource.php b/Obs/Internal/Resource/OBSRequestResource.php index f2971a8..38ceb42 100644 --- a/Obs/Internal/Resource/OBSRequestResource.php +++ b/Obs/Internal/Resource/OBSRequestResource.php @@ -2847,6 +2847,11 @@ class OBSRequestResource { 'type' => 'string', 'location' => 'dns' ], + 'Callback' => [ + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-obs-callback' + ], 'Key' => [ 'required' => true, 'type' => 'string', @@ -3921,6 +3926,11 @@ class OBSRequestResource { 'type' => 'string', 'location' => 'query', 'sentAs' => 'uploadId' + ], + 'Callback' => [ + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-obs-callback' ] ], 'responseParameters' => [ @@ -4181,7 +4191,99 @@ class OBSRequestResource { ] ] ] - ] + ], + + 'setBucketCustomDomain' => [ + 'httpMethod' => 'PUT', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ], + 'DomainName' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'customdomain' + ] + + ], + 'responseParameters' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ] + ] + ], + + 'getBucketCustomDomain' => [ + 'httpMethod' => 'GET', + 'specialParam' => 'customdomain', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ] + ], + 'responseParameters' => [ + 'type' => 'object', + 'properties' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ], + 'Domains' => [ + 'type' => 'array', + 'location' => 'xml', + 'sentAs' => 'Domains', + 'data' => [ + 'xmlFlattened' => true + ], + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'DomainName' => [ + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'DomainName' + ], + 'CreateTime' => [ + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'CreateTime' + ], + ] + ] + ] + ] + ] + ], + + 'deleteBucketCustomDomain' => [ + 'httpMethod' => 'DELETE', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ], + 'DomainName' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'customdomain' + ] + ], + 'responseParameters' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ] + ] + ], + ], 'aliases' => [ diff --git a/Obs/Internal/Resource/V2RequestResource.php b/Obs/Internal/Resource/V2RequestResource.php index e7c2ef2..a59c995 100644 --- a/Obs/Internal/Resource/V2RequestResource.php +++ b/Obs/Internal/Resource/V2RequestResource.php @@ -2683,6 +2683,11 @@ class V2RequestResource { 'type' => 'string', 'location' => 'uri' ], + 'Callback' => [ + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-amz-callback' + ], 'ContentMD5' => [ 'type' => 'string', 'location' => 'header', @@ -3733,6 +3738,11 @@ class V2RequestResource { 'type' => 'string', 'location' => 'query', 'sentAs' => 'uploadId' + ], + 'Callback' => [ + 'type' => 'string', + 'location' => 'header', + 'sentAs' => 'x-amz-callback' ] ], 'responseParameters' => [ @@ -3999,7 +4009,98 @@ class V2RequestResource { ] ] ] - ] + ], + + 'setBucketCustomDomain' => [ + 'httpMethod' => 'PUT', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ], + 'DomainName' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'customdomain' + ] + + ], + 'responseParameters' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ] + ] + ], + + 'getBucketCustomDomain' => [ + 'httpMethod' => 'GET', + 'specialParam' => 'customdomain', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ] + ], + 'responseParameters' => [ + 'type' => 'object', + 'properties' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ], + 'Domains' => [ + 'type' => 'array', + 'location' => 'xml', + 'sentAs' => 'Domains', + 'data' => [ + 'xmlFlattened' => true + ], + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'DomainName' => [ + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'DomainName' + ], + 'CreateTime' => [ + 'type' => 'string', + 'location' => 'xml', + 'sentAs' => 'CreateTime' + ], + ] + ] + ] + ] + ] + ], + + 'deleteBucketCustomDomain' => [ + 'httpMethod' => 'DELETE', + 'requestParameters' => [ + 'Bucket' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'dns' + ], + 'DomainName' => [ + 'required' => true, + 'type' => 'string', + 'location' => 'query', + 'sentAs' => 'customdomain' + ] + ], + 'responseParameters' => [ + 'RequestId' => [ + 'location' => 'header', + 'sentAs' => 'x-obs-request-id' + ] + ] + ], ], 'aliases' => [ diff --git a/Obs/ObsClient.php b/Obs/ObsClient.php index 86206b4..41dc4bd 100644 --- a/Obs/ObsClient.php +++ b/Obs/ObsClient.php @@ -398,7 +398,7 @@ private static function choose_handler($obsclient) } elseif (function_exists('curl_multi_exec')) { $f = new SdkCurlFactory(50); $obsclient->factorys[] = $f; - $handler = new CurlMultiHandler(['handle_factory' => $f1]); + $handler = new CurlMultiHandler(['handle_factory' => $f]); } if (ini_get('allow_url_fopen')) { diff --git a/README.md b/README.md index 54592bb..d3a3f50 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ Version 3.22.6 +新特性: +1. 新增自定义域名相关接口; +2. 新增上传回调参数; + +资料&demo: + +修复问题: +1. 优化部分代码; + +---- + +Version 3.22.6 + 新特性: 资料&demo: diff --git a/composer.json b/composer.json index f6b2e07..68da5be 100644 --- a/composer.json +++ b/composer.json @@ -2,12 +2,13 @@ "name" : "obs/esdk-obs-php", "description" : "OBS PHP SDK", "license":"Apache-2.0", - "version":"3.22.6", + "version":"3.23.5", "require" : { "php" : ">=5.6.0", "guzzlehttp/guzzle" : "^6.3.0 || ^7.0", "guzzlehttp/psr7" : "^1.4.2 || ^2.0", - "monolog/monolog" : "^1.23.0 || ^2.0" + "monolog/monolog" : "^1.23.0 || ^2.0", + "psr/http-message": "^1.0" }, "keywords" :["obs", "php"], @@ -16,4 +17,4 @@ "Obs\\": "Obs/" } } -} +} \ No newline at end of file