put_bucketQuota.php 476 B

12345678910111213141516171819202122
  1. <?php
  2. require_once __DIR__ . '/../autoload.php';
  3. use Qiniu\Auth;
  4. $accessKey = getenv('QINIU_ACCESS_KEY');
  5. $secretKey = getenv('QINIU_SECRET_KEY');
  6. $auth = new Auth($accessKey, $secretKey);
  7. $config = new \Qiniu\Config();
  8. $bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
  9. $bucket = 'xxxx';
  10. $size = 99999;
  11. $count = 99;
  12. list($Info, $err) = $bucketManager->putBucketQuota($bucket, $size, $count);
  13. if ($err) {
  14. print_r($err);
  15. } else {
  16. print_r($Info);
  17. }