Skip to content

Commit 809d816

Browse files
authored
Merge branch 'master' into master
2 parents fe43efd + 628b418 commit 809d816

File tree

5 files changed

+46
-4
lines changed

5 files changed

+46
-4
lines changed

examples/persistent_fop_status.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33

44
use Qiniu\Processing\PersistentFop;
55

6+
$pfop = new Qiniu\Processing\PersistentFop(null, null);
7+
68
// 触发持久化处理后返回的 Id
7-
$persistentId = 'z0.564d5f977823de48a85ece59';
9+
$persistentId = 'z1.5b8a48e5856db843bc24cfc3';
810

911
// 通过persistentId查询该 触发持久化处理的状态
10-
$status = PersistentFop::status($persistentId);
12+
list($ret, $err) = $pfop->status($persistentId);
1113

12-
var_dump($status);
14+
if ($err) {
15+
print_r($err);
16+
} else {
17+
print_r($ret);
18+
}

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/Cdn/CdnManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public static function createTimestampAntiLeechUrl($rawUrl, $encryptKey, $durati
175175
$deadline = time() + $durationInSeconds;
176176
$expireHex = dechex($deadline);
177177
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
178+
$path = implode('/', array_map('rawurlencode', explode('/', $path)));
178179

179180
$strToSign = $encryptKey . $path . $expireHex;
180181
$signStr = md5($strToSign);

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
{

tests/Qiniu/Tests/ResumeUpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function test4ML()
3535
public function test4ML2()
3636
{
3737
$key = 'resumePutFile4ML';
38-
$zone = new Zone(array('up.fake.qiniu.com'), array('up.qiniup.com'));
38+
$zone = new Zone(array('up.qiniup.com'));
3939
$cfg = new Config($zone);
4040
$upManager = new UploadManager($cfg);
4141
$token = $this->auth->uploadToken($this->bucketName, $key);

0 commit comments

Comments
 (0)