Commit ccfe4071 by xmy

cmq配置

parent 0bb14237
......@@ -24,18 +24,19 @@ class Account
:: CMQClientParameterException host格式错误
*/
public function __construct($host, $secretId, $secretKey)
{
$this->host = $host;
$this->secretId = $secretId;
$this->secretKey = $secretKey;
$this->cmq_client = new CMQClient($host, $secretId, $secretKey);
}
/*
* @type sign_method:string
* @param sign_method : only support sha1 and sha256
*/
public function __construct($host = '', $secretId = '', $secretKey = '')
{
$config = include alias('@vendor/hdll/services/src/Common/Config') . '/config.php';
$this->host = $host ?? $config['host'];
$this->secretId = $secretId ?? $config['secretId'];
$this->secretKey = $secretKey ?? $config['secretKey'];
$this->cmq_client = new CMQClient($host, $secretId, $secretKey);
}
/*
* @type sign_method:string
* @param sign_method : only support sha1 and sha256
*/
public function set_sign_method($sign_method = 'sha1')
{
$this->cmq_client->set_sign_method($sign_method);
......
......@@ -18,9 +18,10 @@ return [
'secretKey' => 'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ',
],
'cmq' => [
'host' => '',
'secretId' => '',
'secretKey' => '',
// 'host' => 'http: //cmq-queue-bj.api.tencentyun.com',//内网
'host' => 'http://cmq-queue-bj.api.qcloud.com',//外网
'secretId' => 'AKIDYRW1cG2iVIg8dAoCe86vhNuA7A5oNknk',
'secretKey' => 'z0ymS7xfLrP6Sk2EKHWaXN6d0EIxX0IQ',
],
'cryptKey' => 'ebf032f01aa2093be3ee2ee2c137hdll',
];
\ No newline at end of file
......@@ -26,7 +26,7 @@ class Xcrypt{
{
$config = include alias('@vendor/hdll/services/src/Common/Config') . '/config.php';
$config = $config['qCloud'];
$key = isset($config['cryptKey']) ? $config['cryptKey'] : $key;
$key = $key ?? $config['cryptKey'];
switch (strlen($key)) {
case 8:
$this->mcrypt = MCRYPT_DES;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment