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 396474a9..29bf0dcd 100644 --- a/src/Qiniu/Config.php +++ b/src/Qiniu/Config.php @@ -3,13 +3,13 @@ final class Config { - const SDK_VER = '7.7.0'; + const SDK_VER = '7.8.0'; const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改 - const RSF_HOST = 'rsf.qiniu.com'; - const API_HOST = 'api.qiniu.com'; - const RS_HOST = 'rs.qiniu.com'; //RS Host + const RSF_HOST = 'rsf.qiniuapi.com'; + const API_HOST = 'api.qiniuapi.com'; + 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 9eb9ebda..0f2dee20 100644 --- a/src/Qiniu/Region.php +++ b/src/Qiniu/Region.php @@ -24,9 +24,9 @@ class Region public function __construct( $srcUpHosts = array(), $cdnUpHosts = array(), - $rsHost = "rs.qiniu.com", - $rsfHost = "rsf.qiniu.com", - $apiHost = "api.qiniu.com", + $rsHost = "rs-z0.qiniuapi.com", + $rsfHost = "rsf-z0.qiniuapi.com", + $apiHost = "api.qiniuapi.com", $iovipHost = null ) { @@ -42,11 +42,11 @@ 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'), - 'rs.qbox.me', - 'rsf.qbox.me', - 'api.qiniu.com', + array("up.qiniup.com"), + array('upload.qiniup.com'), + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', + 'api.qiniuapi.com', 'iovip.qbox.me' ); return $regionHuadong; @@ -57,9 +57,9 @@ public static function qvmRegionHuadong() { $qvmRegionHuadong = new Region( array("free-qvm-z0-xs.qiniup.com"), - 'rs.qbox.me', - 'rsf.qbox.me', - 'api.qiniu.com', + 'rs-z0.qiniuapi.com', + 'rsf-z0.qiniuapi.com', + 'api.qiniuapi.com', 'iovip.qbox.me' ); return $qvmRegionHuadong; @@ -70,9 +70,9 @@ 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", + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", + "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); return $qvmRegionHuabei; @@ -84,9 +84,9 @@ 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", + "rs-z1.qiniuapi.com", + "rsf-z1.qiniuapi.com", + "api-z1.qiniuapi.com", "iovip-z1.qbox.me" ); @@ -97,11 +97,11 @@ 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'), - "rs-z2.qbox.me", - "rsf-z2.qbox.me", - "api-z2.qiniu.com", + array('up-z2.qiniup.com'), + array('upload-z2.qiniup.com'), + "rs-z2.qiniuapi.com", + "rsf-z2.qiniuapi.com", + "api-z2.qiniuapi.com", "iovip-z2.qbox.me" ); return $regionHuanan; @@ -127,9 +127,9 @@ 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", + "rs-na0.qiniuapi.com", + "rsf-na0.qiniuapi.com", + "api-na0.qiniuapi.com", "iovip-na0.qbox.me" ); return $regionNorthAmerica; @@ -142,9 +142,9 @@ 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", + "rs-as0.qiniuapi.com", + "rsf-as0.qiniuapi.com", + "api-as0.qiniuapi.com", "iovip-as0.qbox.me" ); return $regionSingapore; @@ -197,33 +197,33 @@ 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->apiHost = "api-z1.qiniu.com"; + $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->apiHost = "api-z2.qiniu.com"; + $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->apiHost = "api-na0.qiniu.com"; + $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->apiHost = "api-as0.qiniu.com"; + $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->apiHost = "api.qiniu.com"; + $Region->rsHost = "rs.qiniuapi.com"; + $Region->rsfHost = "rsf.qiniuapi.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()