1 | <?php |
||
2 | require_once __DIR__ . '/../autoload.php'; |
||
3 | |||
4 | use Qiniu\Auth; |
||
5 | use Qiniu\Storage\BucketManager; |
||
6 | |||
7 | // 控制台获取密钥:https://portal.qiniu.com/user/key |
||
8 | $accessKey = getenv('QINIU_ACCESS_KEY'); |
||
9 | $secretKey = getenv('QINIU_SECRET_KEY'); |
||
10 | $bucket = getenv('QINIU_TEST_BUCKET'); |
||
11 | |||
12 | $auth = new Auth($accessKey, $secretKey); |
||
13 | $bucketManager = new BucketManager($auth); |
||
14 | |||
15 | // 资源列举 V2 |
||
16 | // https://developer.qiniu.com/kodo/api/4539/v2-list |
||
17 | |||
18 | // 要列取文件的公共前缀 |
||
19 | $prefix = ''; |
||
20 | |||
21 | // 上次列举返回的位置标记,作为本次列举的起点信息。 |
||
22 | $marker = ''; |
||
23 | |||
24 | // 本次列举的条目数,范围为 1-1000 |
||
25 | $limit = 1000; |
||
26 | |||
27 | $delimiter = ''; |
||
28 | |||
29 | list($ret, $err) = $bucketManager->listFilesv2($bucket, $prefix, $marker, $limit, $delimiter, true); |
||
0 ignored issues
–
show
|
|||
30 | if ($err != null) { |
||
31 | var_dump($err); |
||
32 | } else { |
||
33 | var_dump($ret); |
||
34 | } |
||
35 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.