From cbee4d28511d342303bf9a7816c8b83ad43b69a5 Mon Sep 17 00:00:00 2001 From: LiHS Date: Tue, 7 Jun 2022 03:30:58 +0800 Subject: [PATCH 1/4] remove deprecate domains --- src/Qiniu/Region.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Qiniu/Region.php b/src/Qiniu/Region.php index 9eb9ebda..ca708957 100644 --- a/src/Qiniu/Region.php +++ b/src/Qiniu/Region.php @@ -42,8 +42,8 @@ public function __construct( 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'), + array("up.qiniup.com"), + array('upload.qiniup.com'), 'rs.qbox.me', 'rsf.qbox.me', 'api.qiniu.com', @@ -97,8 +97,8 @@ public static function 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'), + array('up-z2.qiniup.com'), + array('upload-z2.qiniup.com'), "rs-z2.qbox.me", "rsf-z2.qbox.me", "api-z2.qiniu.com", From 9b4104987a4cefc34741121d594dcb7449169ea2 Mon Sep 17 00:00:00 2001 From: LiHS Date: Tue, 14 Jun 2022 10:27:33 +0800 Subject: [PATCH 2/4] remove deprecate api domain --- src/Qiniu/Config.php | 2 +- src/Qiniu/Region.php | 26 +++++++++++++------------- src/Qiniu/Storage/BucketManager.php | 2 +- tests/Qiniu/Tests/ConfigTest.php | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Qiniu/Config.php b/src/Qiniu/Config.php index 396474a9..73c87204 100644 --- a/src/Qiniu/Config.php +++ b/src/Qiniu/Config.php @@ -8,7 +8,7 @@ final class Config const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改 const RSF_HOST = 'rsf.qiniu.com'; - const API_HOST = 'api.qiniu.com'; + const API_HOST = 'api.qiniuapi.com'; const RS_HOST = 'rs.qiniu.com'; //RS Host const UC_HOST = 'uc.qbox.me'; //UC Host const RTCAPI_HOST = 'http://rtc.qiniuapi.com'; diff --git a/src/Qiniu/Region.php b/src/Qiniu/Region.php index ca708957..6879f754 100644 --- a/src/Qiniu/Region.php +++ b/src/Qiniu/Region.php @@ -26,7 +26,7 @@ public function __construct( $cdnUpHosts = array(), $rsHost = "rs.qiniu.com", $rsfHost = "rsf.qiniu.com", - $apiHost = "api.qiniu.com", + $apiHost = "api.qiniuapi.com", $iovipHost = null ) { @@ -46,7 +46,7 @@ public static function regionHuadong() array('upload.qiniup.com'), 'rs.qbox.me', 'rsf.qbox.me', - 'api.qiniu.com', + 'api.qiniuapi.com', 'iovip.qbox.me' ); return $regionHuadong; @@ -59,7 +59,7 @@ public static function qvmRegionHuadong() array("free-qvm-z0-xs.qiniup.com"), 'rs.qbox.me', 'rsf.qbox.me', - 'api.qiniu.com', + 'api.qiniuapi.com', 'iovip.qbox.me' ); return $qvmRegionHuadong; @@ -72,7 +72,7 @@ public static function qvmRegionHuabei() array("free-qvm-z1-zz.qiniup.com"), "rs-z1.qbox.me", "rsf-z1.qbox.me", - "api-z1.qiniu.com", + "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); return $qvmRegionHuabei; @@ -86,7 +86,7 @@ public static function regionHuabei() array('upload-z1.qiniup.com'), "rs-z1.qbox.me", "rsf-z1.qbox.me", - "api-z1.qiniu.com", + "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); @@ -101,7 +101,7 @@ public static function regionHuanan() array('upload-z2.qiniup.com'), "rs-z2.qbox.me", "rsf-z2.qbox.me", - "api-z2.qiniu.com", + "api-z2.qiniuapi.com", "iovip-z2.qbox.me" ); return $regionHuanan; @@ -129,7 +129,7 @@ public static function regionNorthAmerica() array('upload-na0.qiniup.com'), "rs-na0.qbox.me", "rsf-na0.qbox.me", - "api-na0.qiniu.com", + "api-na0.qiniuapi.com", "iovip-na0.qbox.me" ); return $regionNorthAmerica; @@ -144,7 +144,7 @@ public static function regionSingapore() array('upload-as0.qiniup.com'), "rs-as0.qbox.me", "rsf-as0.qbox.me", - "api-as0.qiniu.com", + "api-as0.qiniuapi.com", "iovip-as0.qbox.me" ); return $regionSingapore; @@ -199,11 +199,11 @@ public static function queryRegion($ak, $bucket) if (strstr($Region->iovipHost, "z1") !== false) { $Region->rsHost = "rs-z1.qbox.me"; $Region->rsfHost = "rsf-z1.qbox.me"; - $Region->apiHost = "api-z1.qiniu.com"; + $Region->apiHost = "api-z1.qiniuapi.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"; + $Region->apiHost = "api-z2.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "cn-east-2") !== false) { $Region->rsHost = "rs-cn-east-2.qiniuapi.com"; $Region->rsfHost = "rsf-cn-east-2.qiniuapi.com"; @@ -211,11 +211,11 @@ public static function queryRegion($ak, $bucket) } elseif (strstr($Region->iovipHost, "na0") !== false) { $Region->rsHost = "rs-na0.qbox.me"; $Region->rsfHost = "rsf-na0.qbox.me"; - $Region->apiHost = "api-na0.qiniu.com"; + $Region->apiHost = "api-na0.qiniuapi.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"; + $Region->apiHost = "api-as0.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "ap-northeast-1") !== false) { $Region->rsHost = "rs-ap-northeast-1.qiniuapi.com"; $Region->rsfHost = "rsf-ap-northeast-1.qiniuapi.com"; @@ -223,7 +223,7 @@ public static function queryRegion($ak, $bucket) } else { $Region->rsHost = "rs.qbox.me"; $Region->rsfHost = "rsf.qbox.me"; - $Region->apiHost = "api.qiniu.com"; + $Region->apiHost = "api.qiniuapi.com"; } return $Region; diff --git a/src/Qiniu/Storage/BucketManager.php b/src/Qiniu/Storage/BucketManager.php index 2fa5e3cd..8cf35a39 100644 --- a/src/Qiniu/Storage/BucketManager.php +++ b/src/Qiniu/Storage/BucketManager.php @@ -847,7 +847,7 @@ public function asynchFetchStatus($zone, $id) $scheme = "https://"; } - $url = $scheme . "api-" . $zone . ".qiniu.com/sisyphus/fetch?id=" . $id; + $url = $scheme . "api-" . $zone . ".qiniuapi.com/sisyphus/fetch?id=" . $id; list($ret, $err) = $this->getV2($url); diff --git a/tests/Qiniu/Tests/ConfigTest.php b/tests/Qiniu/Tests/ConfigTest.php index 9d19a0bd..18bddba8 100644 --- a/tests/Qiniu/Tests/ConfigTest.php +++ b/tests/Qiniu/Tests/ConfigTest.php @@ -27,7 +27,7 @@ public function testGetApiHost() $hasException = true; } $this->assertFalse($hasException); - $this->assertEquals('http://api.qiniu.com', $apiHost); + $this->assertEquals('http://api.qiniuapi.com', $apiHost); } public function testGetApiHostErrored() @@ -47,7 +47,7 @@ public function testGetApiHostV2() $conf = new Config(); list($apiHost, $err) = $conf->getApiHostV2($this->accessKey, $this->bucketName); $this->assertNull($err); - $this->assertEquals('http://api.qiniu.com', $apiHost); + $this->assertEquals('http://api.qiniuapi.com', $apiHost); } public function testGetApiHostV2Errored() From 7886e2e048717197887c15115c2344ad010a97e0 Mon Sep 17 00:00:00 2001 From: LiHS Date: Mon, 20 Jun 2022 16:48:11 +0800 Subject: [PATCH 3/4] replace deprecated rs, rsf domains to *.qiniuapi.com --- src/Qiniu/Config.php | 4 ++-- src/Qiniu/Region.php | 52 ++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Qiniu/Config.php b/src/Qiniu/Config.php index 73c87204..b69b6592 100644 --- a/src/Qiniu/Config.php +++ b/src/Qiniu/Config.php @@ -7,9 +7,9 @@ final class Config const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改 - const RSF_HOST = 'rsf.qiniu.com'; + const RSF_HOST = 'rsf.qiniuapi.com'; const API_HOST = 'api.qiniuapi.com'; - const RS_HOST = 'rs.qiniu.com'; //RS Host + const RS_HOST = 'rs.qiniuapi.com'; //RS Host const UC_HOST = 'uc.qbox.me'; //UC Host const RTCAPI_HOST = 'http://rtc.qiniuapi.com'; const ARGUS_HOST = 'ai.qiniuapi.com'; diff --git a/src/Qiniu/Region.php b/src/Qiniu/Region.php index 6879f754..0f2dee20 100644 --- a/src/Qiniu/Region.php +++ b/src/Qiniu/Region.php @@ -24,8 +24,8 @@ class Region public function __construct( $srcUpHosts = array(), $cdnUpHosts = array(), - $rsHost = "rs.qiniu.com", - $rsfHost = "rsf.qiniu.com", + $rsHost = "rs-z0.qiniuapi.com", + $rsfHost = "rsf-z0.qiniuapi.com", $apiHost = "api.qiniuapi.com", $iovipHost = null ) { @@ -44,8 +44,8 @@ public static function regionHuadong() $regionHuadong = new Region( array("up.qiniup.com"), array('upload.qiniup.com'), - 'rs.qbox.me', - 'rsf.qbox.me', + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', 'api.qiniuapi.com', 'iovip.qbox.me' ); @@ -57,8 +57,8 @@ public static function qvmRegionHuadong() { $qvmRegionHuadong = new Region( array("free-qvm-z0-xs.qiniup.com"), - 'rs.qbox.me', - 'rsf.qbox.me', + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', 'api.qiniuapi.com', 'iovip.qbox.me' ); @@ -70,8 +70,8 @@ public static function qvmRegionHuabei() { $qvmRegionHuabei = new Region( array("free-qvm-z1-zz.qiniup.com"), - "rs-z1.qbox.me", - "rsf-z1.qbox.me", + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); @@ -84,8 +84,8 @@ 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", + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); @@ -99,8 +99,8 @@ public static function regionHuanan() $regionHuanan = new Region( array('up-z2.qiniup.com'), array('upload-z2.qiniup.com'), - "rs-z2.qbox.me", - "rsf-z2.qbox.me", + "rs-z2.qiniuapi.com", + "rsf-z2.qiniuapi.com", "api-z2.qiniuapi.com", "iovip-z2.qbox.me" ); @@ -127,8 +127,8 @@ 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", + "rs-na0.qiniuapi.com", + "rsf-na0.qiniuapi.com", "api-na0.qiniuapi.com", "iovip-na0.qbox.me" ); @@ -142,8 +142,8 @@ 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", + "rs-as0.qiniuapi.com", + "rsf-as0.qiniuapi.com", "api-as0.qiniuapi.com", "iovip-as0.qbox.me" ); @@ -197,32 +197,32 @@ public static function queryRegion($ak, $bucket) //set specific hosts if (strstr($Region->iovipHost, "z1") !== false) { - $Region->rsHost = "rs-z1.qbox.me"; - $Region->rsfHost = "rsf-z1.qbox.me"; + $Region->rsHost = "rs-z1.qiniuapi.com"; + $Region->rsfHost = "rsf-z1.qiniuapi.com"; $Region->apiHost = "api-z1.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "z2") !== false) { - $Region->rsHost = "rs-z2.qbox.me"; - $Region->rsfHost = "rsf-z2.qbox.me"; + $Region->rsHost = "rs-z2.qiniuapi.com"; + $Region->rsfHost = "rsf-z2.qiniuapi.com"; $Region->apiHost = "api-z2.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "cn-east-2") !== false) { $Region->rsHost = "rs-cn-east-2.qiniuapi.com"; $Region->rsfHost = "rsf-cn-east-2.qiniuapi.com"; $Region->apiHost = "api-cn-east-2.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "na0") !== false) { - $Region->rsHost = "rs-na0.qbox.me"; - $Region->rsfHost = "rsf-na0.qbox.me"; + $Region->rsHost = "rs-na0.qiniuapi.com"; + $Region->rsfHost = "rsf-na0.qiniuapi.com"; $Region->apiHost = "api-na0.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "as0") !== false) { - $Region->rsHost = "rs-as0.qbox.me"; - $Region->rsfHost = "rsf-as0.qbox.me"; + $Region->rsHost = "rs-as0.qiniuapi.com"; + $Region->rsfHost = "rsf-as0.qiniuapi.com"; $Region->apiHost = "api-as0.qiniuapi.com"; } elseif (strstr($Region->iovipHost, "ap-northeast-1") !== false) { $Region->rsHost = "rs-ap-northeast-1.qiniuapi.com"; $Region->rsfHost = "rsf-ap-northeast-1.qiniuapi.com"; $Region->apiHost = "api-ap-northeast-1.qiniuapi.com"; } else { - $Region->rsHost = "rs.qbox.me"; - $Region->rsfHost = "rsf.qbox.me"; + $Region->rsHost = "rs.qiniuapi.com"; + $Region->rsfHost = "rsf.qiniuapi.com"; $Region->apiHost = "api.qiniuapi.com"; } From 7baa972a50bdbe6e187bd16c1fa37a7aafb8879a Mon Sep 17 00:00:00 2001 From: LiHS Date: Tue, 25 Oct 2022 16:07:36 +0800 Subject: [PATCH 4/4] Update CHANGELOG.md and Config.php --- CHANGELOG.md | 5 +++++ src/Qiniu/Config.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7dca188..e1948c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 7.8.0 (2022-10-25) +* 移除不推荐域名,并增加区域亚太-首尔和华东-浙江2 +* 对象存储,修复断点上传的文件内容不正确 +* 对象存储,优化分片上传 ctx 超时检测 + ## 7.7.0 (2022-09-02) * 对象存储,新增支持设置文件级别生命周期 setObjectLifecycle API * 对象存储,内置增加七牛新建存储区域域名信息 diff --git a/src/Qiniu/Config.php b/src/Qiniu/Config.php index b69b6592..29bf0dcd 100644 --- a/src/Qiniu/Config.php +++ b/src/Qiniu/Config.php @@ -3,7 +3,7 @@ final class Config { - const SDK_VER = '7.7.0'; + const SDK_VER = '7.8.0'; const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改