Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
ccfe4071
Commit
ccfe4071
authored
Nov 22, 2018
by
xmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmq配置
parent
0bb14237
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
src/Cmq/Account.php
+13
-12
src/Common/Config/config.php
+5
-3
src/Common/Lib/Xcrypt.php
+1
-1
No files found.
src/Cmq/Account.php
View file @
ccfe4071
...
...
@@ -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
);
...
...
src/Common/Config/config.php
View file @
ccfe4071
...
...
@@ -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
src/Common/Lib/Xcrypt.php
View file @
ccfe4071
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment