20 lines
450 B
PHP
Raw Normal View History

2023-05-10 13:39:12 +08:00
<?php
require_once __DIR__ . '/../autoload.php';
2024-02-28 16:51:38 +08:00
use \Qiniu\Auth;
2023-05-10 13:39:12 +08:00
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
2024-02-28 16:51:38 +08:00
$bucket = getenv('QINIU_TEST_BUCKET');
2023-05-10 13:39:12 +08:00
2023-11-02 14:13:04 +08:00
2024-02-28 16:51:38 +08:00
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($buckets, $err) = $bucketManager->buckets(true);
if ($err) {
print_r($err);
2023-05-10 13:39:12 +08:00
} else {
2024-02-28 16:51:38 +08:00
print_r($buckets);
2023-05-10 13:39:12 +08:00
}