File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ to the require section of your composer.json.
2222使用方式
2323------------
2424```
25- $client = new \aliyun\live\Client('123456', '123456');
25+ $client = new \aliyun\live\Client([
26+ 'accessKeyId' => '123456',
27+ 'accessSecret' => '123456'
28+ ]);
2629$package = [
2730 'Action' => 'DescribeLiveStreamsPublishList',
2831 'DomainName' => 'live.cctv.com',
Original file line number Diff line number Diff line change @@ -40,23 +40,29 @@ class Client
4040 */
4141 public $ signer ;
4242
43- /**
44- * Client constructor.
45- * @param string $accessKeyId
46- * @param string $accessSecret
47- */
48- public function __construct ($ accessKeyId , $ accessSecret )
49- {
50- $ this ->accessKeyId = $ accessKeyId ;
51- $ this ->accessSecret = $ accessSecret ;
52- $ this ->signer = new ShaHmac1Signer ();
53- }
43+
5444
5545 /**
5646 * @var \GuzzleHttp\Client
5747 */
5848 public $ _httpClient ;
5949
50+ /**
51+ * Request constructor.
52+ * @param array $config
53+ */
54+ public function __construct ($ config = [])
55+ {
56+ foreach ($ config as $ name => $ value ) {
57+ $ this ->{$ name } = $ value ;
58+ }
59+ $ this ->init ();
60+ }
61+
62+ public function init (){
63+ $ this ->signer = new ShaHmac1Signer ();
64+ }
65+
6066 /**
6167 * 获取Http Client
6268 * @return \GuzzleHttp\Client
You can’t perform that action at this time.
0 commit comments