Skip to content

Commit bc9cc93

Browse files
authored
Merge pull request #288 from ankadada/master
Add QVMzone
2 parents 324db49 + c601dd7 commit bc9cc93

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

examples/upload_and_callback.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
use Qiniu\Auth;
55
use Qiniu\Storage\UploadManager;
66

7+
// use Qiniu\Config;
8+
// use Qiniu\Zone;
9+
10+
// 指定zone上传
11+
// $zone = Zone::zoneZ0(); //华东QVM内网上传指定host
12+
// $config = new Config($zone);
13+
714
$accessKey = getenv('QINIU_ACCESS_KEY');
815
$secretKey = getenv('QINIU_SECRET_KEY');
916
$bucket = getenv('QINIU_TEST_BUCKET');
@@ -20,6 +27,8 @@
2027
//上传文件的本地路径
2128
$filePath = './php-logo.png';
2229

30+
//指定 config
31+
// $uploadMgr = new UploadManager($config);
2332
$uploadMgr = new UploadManager();
2433

2534
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)