put_bucketEvent.php 631 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 = 'testdemo';
  11. $prefix = 'test1';
  12. $suffix = 'mp3';
  13. $event = array("move","copy");
  14. $callbackURL = 'http://www.qiniu.com';
  15. list($Info, $err) = $bucketManager->putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL);
  16. if ($err) {
  17. print_r($err);
  18. } else {
  19. print_r($Info);
  20. }