Skip to content

Commit df900ae

Browse files
committed
style:modify demo format
1 parent 4fcae00 commit df900ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+176
-101
lines changed

examples/bucket_lifecycleRule.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
5+
use Qiniu\Config;
6+
use Qiniu\Storage\BucketManager;
57

68
// 控制台获取密钥:https://portal.qiniu.com/user/key
79
$accessKey = getenv('QINIU_ACCESS_KEY');
810
$secretKey = getenv('QINIU_SECRET_KEY');
911

1012
$auth = new Auth($accessKey, $secretKey);
11-
$config = new \Qiniu\Config();
12-
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
13+
$config = new Config();
14+
$bucketManager = new BucketManager($auth, $config);
1315

1416
// 存储空间 - 新增生命周期规则
1517
// 参考文档:https://developer.qiniu.com/kodo/manual/3699/life-cycle-management

examples/cdn_get_bandwidth.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
require_once __DIR__ . '/../autoload.php';
44

5-
use \Qiniu\Cdn\CdnManager;
5+
use Qiniu\Auth;
6+
use Qiniu\Cdn\CdnManager;
67

78
// 控制台获取密钥:https://portal.qiniu.com/user/key
89
$accessKey = getenv('QINIU_ACCESS_KEY');
910
$secretKey = getenv('QINIU_SECRET_KEY');
1011

11-
$auth = new Qiniu\Auth($accessKey, $secretKey);
12+
$auth = new Auth($accessKey, $secretKey);
1213
$cdnManager = new CdnManager($auth);
1314

1415
// 获取流量和带宽数据

examples/cdn_get_flux.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
require_once __DIR__ . '/../autoload.php';
44

5+
use Qiniu\Auth;
56
use \Qiniu\Cdn\CdnManager;
67

78
// 控制台获取密钥:https://portal.qiniu.com/user/key
89
$accessKey = getenv('QINIU_ACCESS_KEY');
910
$secretKey = getenv('QINIU_SECRET_KEY');
1011

11-
$auth = new Qiniu\Auth($accessKey, $secretKey);
12+
$auth = new Auth($accessKey, $secretKey);
1213
$cdnManager = new CdnManager($auth);
1314

1415
// 获取流量和带宽数据

examples/cdn_get_log_list.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
require_once __DIR__ . '/../autoload.php';
44

5-
use \Qiniu\Cdn\CdnManager;
5+
use Qiniu\Auth;
6+
use Qiniu\Cdn\CdnManager;
67

78
// 控制台获取密钥:https://portal.qiniu.com/user/key
89
$accessKey = getenv('QINIU_ACCESS_KEY');
910
$secretKey = getenv('QINIU_SECRET_KEY');
1011

11-
$auth = new Qiniu\Auth($accessKey, $secretKey);
12+
$auth = new Auth($accessKey, $secretKey);
1213
$cdnManager = new CdnManager($auth);
1314

1415
// 获取日志下载链接

examples/cdn_refresh_urls_dirs.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
require_once __DIR__ . '/../autoload.php';
44

5-
use \Qiniu\Cdn\CdnManager;
5+
use Qiniu\Auth;
6+
use Qiniu\Cdn\CdnManager;
67

78
// 控制台获取密钥:https://portal.qiniu.com/user/key
89
$accessKey = getenv('QINIU_ACCESS_KEY');
910
$secretKey = getenv('QINIU_SECRET_KEY');
1011

11-
$auth = new Qiniu\Auth($accessKey, $secretKey);
12+
$auth = new Auth($accessKey, $secretKey);
1213

1314
//---------------------------------------- demo1 ----------------------------------------
1415
// 刷新文件和目录

examples/cdn_timestamp_antileech.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
require_once __DIR__ . '/../autoload.php';
44

5-
use \Qiniu\Cdn\CdnManager;
5+
use Qiniu\Cdn\CdnManager;
66

77
// 创建带时间戳防盗链的 URL
88
// 参考文档:https://developer.qiniu.com/fusion/manual/3841/timestamp-hotlinking-prevention-fusion
99

1010
$encryptKey = 'your_domain_timestamp_antileech_encryptkey';
1111

1212
// 一定要带访问协议,也就是 http:// 或者 https://
13-
$url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo';
13+
$url1 = 'http://phpsdk.qiniuts.com/24.jpg?imageInfo';
1414
$url2 = 'http://phpsdk.qiniuts.com/24.jpg';
1515

1616
// 有效期时间(单位秒)

examples/delete_bucket.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
5+
use Qiniu\Config;
6+
use Qiniu\Storage\BucketManager;
57

68
// 控制台获取密钥:https://portal.qiniu.com/user/key
79
$accessKey = getenv('QINIU_ACCESS_KEY');
810
$secretKey = getenv('QINIU_SECRET_KEY');
911

1012
$auth = new Auth($accessKey, $secretKey);
11-
$config = new \Qiniu\Config();
12-
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
13+
$config = new Config();
14+
$bucketManager = new BucketManager($auth, $config);
1315

1416
// 删除指定的 Bucket
1517
// 1、空间绑定了自定义域名,禁止删除,需要先解绑域名

examples/delete_bucketEvent.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
5+
use Qiniu\Config;
6+
use Qiniu\Storage\BucketManager;
57

68
// 控制台获取密钥:https://portal.qiniu.com/user/key
79
$accessKey = getenv('QINIU_ACCESS_KEY');
810
$secretKey = getenv('QINIU_SECRET_KEY');
911

1012
$auth = new Auth($accessKey, $secretKey);
11-
$config = new \Qiniu\Config();
12-
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
13+
$config = new Config();
14+
$bucketManager = new BucketManager($auth, $config);
1315

1416
// 删除 bucket 事件通知规则
1517
// 参考文档:https://developer.qiniu.com/kodo/manual/6095/event-notification

examples/delete_bucketLifecycleRule.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
5+
use Qiniu\Config;
6+
use Qiniu\Storage\BucketManager;
57

68
// 控制台获取密钥:https://portal.qiniu.com/user/key
79
$accessKey = getenv('QINIU_ACCESS_KEY');
810
$secretKey = getenv('QINIU_SECRET_KEY');
911

1012
$auth = new Auth($accessKey, $secretKey);
11-
$config = new \Qiniu\Config();
12-
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
13+
$config = new Config();
14+
$bucketManager = new BucketManager($auth, $config);
1315

1416
// 删除存储空间 - 生命周期规则
1517
// 参考文档:https://developer.qiniu.com/kodo/manual/3699/life-cycle-management

examples/get_bucketEvents.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
5+
use Qiniu\Config;
6+
use Qiniu\Storage\BucketManager;
57

68
// 控制台获取密钥:https://portal.qiniu.com/user/key
79
$accessKey = getenv('QINIU_ACCESS_KEY');
810
$secretKey = getenv('QINIU_SECRET_KEY');
911

1012
$auth = new Auth($accessKey, $secretKey);
11-
$config = new \Qiniu\Config();
12-
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
13+
$config = new Config();
14+
$bucketManager = new BucketManager($auth, $config);
1315

1416
// 获取存储空间 - 事件通知规则
1517
// 参考文档:https://developer.qiniu.com/kodo/manual/6095/event-notification

0 commit comments

Comments
 (0)