Skip to content

Commit e11f276

Browse files
authored
Fix syntax errors (#181)
close #180
1 parent ecd70eb commit e11f276

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

sample/getObjectUrl.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,29 @@
99
array(
1010
'region' => $region,
1111
'schema' => 'https', //协议头部,默认为http
12-
'credentials'=> array(
13-
'secretId' => $secretId ,
14-
'secretKey' => $secretKey)));
12+
'credentials' => array(
13+
'secretId' => $secretId,
14+
'secretKey' => $secretKey
15+
)
16+
)
17+
);
1518
$local_path = "/data/exampleobject";
1619

17-
try {
20+
try {
1821
$bucket = "examplebucket-1250000000"; //存储桶,格式:BucketName-APPID
1922
$key = "exampleobject"; //对象在存储桶中的位置,即对象键
20-
$signedUrl = $cosClient->getObjectUrl($bucket,
21-
$key,
22-
'+10 minutes' //签名的有效时间
23-
['ResponseContentDisposition' => '111',
24-
'Params' => [ // Params中可以传自定义querystring
25-
'aaa' => 'bbb',
26-
'ccc' => 'ddd'
27-
]]);
23+
$signedUrl = $cosClient->getObjectUrl(
24+
$bucket,
25+
$key,
26+
'+10 minutes', //签名的有效时间
27+
[
28+
'ResponseContentDisposition' => '111',
29+
'Params' => [ // Params中可以传自定义querystring
30+
'aaa' => 'bbb',
31+
'ccc' => 'ddd'
32+
]
33+
]
34+
);
2835
// 请求成功
2936
echo $signedUrl;
3037
} catch (\Exception $e) {

0 commit comments

Comments
 (0)