File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function upload()
7777 $ ret = $ response ->json ();
7878 }
7979 if ($ response ->statusCode < 0 ) {
80- $ this ->host = Config:: UPBACKUP_HOST ;
80+ $ this ->host = $ confg :: $ upBackupHost ;
8181 }
8282 if ($ response ->needRetry () || !isset ($ ret ['crc32 ' ]) || $ crc != $ ret ['crc32 ' ]) {
8383 $ response = $ this ->makeBlock ($ data , $ blockSize );
Original file line number Diff line number Diff line change 44final class Zone
55{
66 public static $ upHost = 'http://up.qiniu.com ' ;
7+ public static $ upBackupHost = 'http://upload.qiniu.com ' ;
78
8- public function __construct ($ upHost )
9+ public function __construct ()
910 {
10- $ this ->upHost = $ upHost ;
11+ }
12+
13+ public function setUpHost ($ host )
14+ {
15+ self ::$ upHost = $ host ;
16+ }
17+
18+ public function setUpBackupHost ($ host )
19+ {
20+ self ::$ upBackupHost = $ host ;
1121 }
1222
1323 public static function zone0 ()
1424 {
15- return new self ( ' http://up.qiniu.com ' ) ;
25+ return new self ;
1626 }
1727
1828 public static function zone1 ()
1929 {
20- return new self ('http://up-z1.qiniu.com ' );
30+ $ z1 = new self ;
31+ $ z1 ->setUpHost ('http://up-z1.qiniu.com ' );
32+ $ z1 ->setUpBackupHost ('http://upload-z1.qiniu.com ' );
33+ return $ z1 ;
2134 }
2235}
You can’t perform that action at this time.
0 commit comments