Skip to content

Commit b376e96

Browse files
committed
update
1 parent d067ede commit b376e96

File tree

1 file changed

+12
-42
lines changed

1 file changed

+12
-42
lines changed

README.md

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ php composer.phar require --prefer-dist xutl/yii2-qcloud
1818
or add
1919

2020
```
21-
"xutl/yii2-qcloud": "~2.0.0"
21+
"xutl/yii2-qcloud": "~3.0.0"
2222
```
2323

2424
to the require section of your `composer.json` file.
@@ -36,56 +36,26 @@ return [
3636
'class' => 'xutl\qcloud\Qcloud',
3737
'secretId' => 'abcdefg',
3838
'secretKey' => 'abcdefg',
39+
'params'=> [//这里是非扩展的配置参数,如队列任务等
40+
'aaa.appvvvKey' => 123456789
41+
],
42+
'components' => [
43+
//各子组件配置,如果无需配置不写即可。也可动态注入配置。
44+
            //如果子组件使用独立的 `secretId` 和 `secretKey` 那么在子组件中单独配置即可,如果没有配置默认使用父 `accessId` 和 `accessKey` 。
45+
            //如果你自己扩展了其他的子组件,这里定义下新的组件配置即可,配置方式,数组接口和 YII 原生组件一致!
46+
            //etc
47+
]
3948
],
4049
]
4150
];
4251
```
4352

4453
使用
4554
----
46-
47-
v1.0
48-
```php
49-
use xutl\qcloud\Qcloud;
50-
51-
/** var Qcloud $qcloud */
52-
$qcloud = Yii::$app->qcloud;
53-
$wenzhi = $qcloud->createRequest(Qcloud::API_WENZHI,'gz');
54-
$package = [
55-
'title'=>'啦啦啦啦啦啦',
56-
"content"=>"操"
57-
];
58-
print_r($wenzhi->TextKeywords($package));
59-
```
60-
61-
v2.0 使用方法 QCloud::API_CNS 这个接口名称,可以直接输入字符串,会和主机头组合起来作为Host,第二个参数是可用区,按照说明可为空,
62-
但是有些地区不能为空。
63-
64-
```php
65-
use xutl\qcloud\Qcloud;
66-
67-
/** var Qcloud $qcloud */
68-
$qcloud = Yii::$app->qcloud;
69-
/** @var \yii\httpclient\Response $response */
70-
$response = $qcloud->createRequest(QCloud::API_CNS)->setData(['Action'=>'DomainList',])->send();;
71-
print_r($response->data);
72-
```
7355

74-
v2.0 使用方法 2 ,适用于没有内置的接口,通过此方法来请求。
7556
```php
76-
use xutl\qcloud\Client;
77-
78-
/** var Client $client */
79-
$request = (new Client([
80-
'serverHost' => 'cns.api.qcloud.com',
81-
'secretId' => '123456',
82-
'secretKey' => '654321',
83-
'region' => null
84-
]))
85-
->createRequest();
86-
87-
/** @var \yii\httpclient\Response $response */
88-
$response = $request->setMethod('POST')->setData(['Action'=>'DomainList',])->send();;
57+
$cdn = Yii::$app->qcloud->cdn;
58+
$response = $cdn->describeCdnHosts();
8959
print_r($response->data);
9060
```
9161

0 commit comments

Comments
 (0)