update_bucketEvent.php 593 B

12345678910111213141516171819202122232425
  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. $name = 'demo';
  11. $prefix = 'test';
  12. $suffix = 'mp4';
  13. $event = 'mkfile';
  14. $callbackURL = 'https://www.qiniu.com';
  15. list($Info, $err) = $bucketManager->updateBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL);
  16. if ($err) {
  17. print_r($err);
  18. } else {
  19. print_r($Info);
  20. }