Skip to content

Commit

Permalink
replace deprecated rs, rsf domains to *.qiniuapi.com
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Oct 25, 2022
1 parent 9b41049 commit 7886e2e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/Qiniu/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
52 changes: 26 additions & 26 deletions src/Qiniu/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand All @@ -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'
);
Expand All @@ -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'
);
Expand All @@ -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"
);
Expand All @@ -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"
);
Expand All @@ -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"
);
Expand All @@ -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"
);
Expand All @@ -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"
);
Expand Down Expand Up @@ -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";
}

Expand Down

0 comments on commit 7886e2e

Please sign in to comment.