Skip to content

Commit 64b99ab

Browse files
committed
add zone file
1 parent 65f569d commit 64b99ab

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/Qiniu/Zone.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
namespace Qiniu;
3+
4+
final Class Zone
5+
{
6+
const ZONE0 = 0, // Zone 常量, 现在有两个zone可以设置,zone0 & zone1
7+
ZONE1 = 1;
8+
9+
public $upHost;
10+
11+
public function __construct($upHost) {
12+
$this->upHost = $upHost;
13+
}
14+
15+
public static function zone0() {
16+
return self::zone(self::ZONE0);
17+
}
18+
19+
public static function zone1() {
20+
return self::zone(self::ZONE1);
21+
}
22+
23+
public static function zone($z) {
24+
switch ($z) {
25+
case self::ZONE0:
26+
return new self('http://up.qiniu.com');
27+
break;
28+
case self::ZONE1:
29+
return new self('http://up-z1.qiniu.com');
30+
break;
31+
}
32+
return;
33+
}
34+
}
35+

0 commit comments

Comments
 (0)