Skip to content

Commit d1859d5

Browse files
committed
cmq
1 parent 1d0512a commit d1859d5

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/QCloud.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use yii\di\ServiceLocator;
1111
use yii\base\InvalidConfigException;
1212
use xutl\qcloud\components\Cdn;
13+
use xutl\qcloud\components\Cmq;
1314

1415
/**
1516
* Class QCloud
@@ -82,15 +83,24 @@ public function getCdn()
8283
return $this->get('cdn');
8384
}
8485

86+
/**
87+
* @return Cmq|object
88+
* @throws InvalidConfigException
89+
*/
90+
public function getCmq()
91+
{
92+
return $this->get('cmq');
93+
}
94+
8595
/**
8696
* Returns the configuration of qcloud components.
8797
* @see set()
8898
*/
8999
public function coreComponents()
90100
{
91101
return [
92-
'ccs' => ['class' => 'xutl\qcloud\components\CCS'],
93102
'cdn' => ['class' => 'xutl\qcloud\components\Cdn'],
103+
'cmq' => ['class' => 'xutl\qcloud\components\Cmq'],
94104
];
95105
}
96106
}

src/components/Cmq.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* @link http://www.tintsoft.com/
4+
* @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
5+
* @license http://www.tintsoft.com/license/
6+
*/
7+
8+
9+
namespace xutl\qcloud\components;
10+
11+
use xutl\qcloud\BaseClient;
12+
use yii\base\InvalidConfigException;
13+
14+
/**
15+
* Class Cmq
16+
* @package xutl\qcloud\components
17+
*
18+
* @author Tongle Xu <[email protected]>
19+
* @since 1.0
20+
*/
21+
class Cmq extends BaseClient
22+
{
23+
/**
24+
* @throws InvalidConfigException
25+
*/
26+
public function init()
27+
{
28+
parent::init();
29+
if (empty ($this->baseUrl)) {
30+
throw new InvalidConfigException ('The "baseUrl" property must be set.');
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)