Skip to content

Commit adf6356

Browse files
committed
Add qvmzone
1 parent 0e96190 commit adf6356

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

examples/upload_and_callback.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
use Qiniu\Auth;
55
use Qiniu\Storage\UploadManager;
6+
// use Qiniu\Config;
7+
// use Qiniu\Zone;
8+
9+
// 指定zone上传
10+
// $zone = Zone::zonez01(); //华东1
11+
// $config = new Config($zone);
612

713
$accessKey = getenv('QINIU_ACCESS_KEY');
814
$secretKey = getenv('QINIU_SECRET_KEY');
@@ -20,6 +26,8 @@
2026
//上传文件的本地路径
2127
$filePath = './php-logo.png';
2228

29+
//指定 config
30+
// $uploadMgr = new UploadManager($config);
2331
$uploadMgr = new UploadManager();
2432

2533
list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath);

src/Qiniu/Zone.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@ public static function zone0()
5252
return $Zone_z0;
5353
}
5454

55+
//华东机房内网上传
56+
public static function zoneZ0()
57+
{
58+
$Zone_z01 = new Zone(
59+
array("free-qvm-z0-xs.qiniup.com"),
60+
'rs.qbox.me',
61+
'rsf.qbox.me',
62+
'api.qiniu.com',
63+
'iovip.qbox.me'
64+
);
65+
return $Zone_z01;
66+
}
67+
68+
//华北机房内网上传
69+
public static function zoneZ1()
70+
{
71+
$Zone_z12 = new Zone(
72+
array("free-qvm-z1-zz.qiniup.com"),
73+
"rs-z1.qbox.me",
74+
"rsf-z1.qbox.me",
75+
"api-z1.qiniu.com",
76+
"iovip-z1.qbox.me"
77+
);
78+
return $Zone_z12;
79+
}
80+
5581
//华北机房
5682
public static function zone1()
5783
{

0 commit comments

Comments
 (0)