Skip to content

Commit

Permalink
Merge pull request #385 from qiniu/fix/remove-deprecate-domains
Browse files Browse the repository at this point in the history
remove deprecate domains
  • Loading branch information
bachue authored Oct 25, 2022
2 parents 5ec1d2a + 7baa972 commit 4bbddbd
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 50 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 7.8.0 (2022-10-25)
* 移除不推荐域名,并增加区域亚太-首尔和华东-浙江2
* 对象存储,修复断点上传的文件内容不正确
* 对象存储,优化分片上传 ctx 超时检测

## 7.7.0 (2022-09-02)
* 对象存储,新增支持设置文件级别生命周期 setObjectLifecycle API
* 对象存储,内置增加七牛新建存储区域域名信息
Expand Down
8 changes: 4 additions & 4 deletions src/Qiniu/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
86 changes: 43 additions & 43 deletions src/Qiniu/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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"
);

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/Storage/BucketManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions tests/Qiniu/Tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 4bbddbd

Please sign in to comment.