Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdz_gateway
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
杨苏杭
cdz_gateway
Commits
53b82674
Commit
53b82674
authored
Jul 30, 2018
by
BANice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改环境变量
parent
2bd9d258
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
15 deletions
+20
-15
.env
+6
-0
.idea/workspace.xml
+0
-0
Lib/rabbitmq/MyRabbitMq.php
+14
-15
No files found.
.env
View file @
53b82674
...
@@ -13,3 +13,8 @@ DB_NAME=cdzpay
...
@@ -13,3 +13,8 @@ DB_NAME=cdzpay
DB_PASSWORD=senthink123
DB_PASSWORD=senthink123
DB_PORT=3306
DB_PORT=3306
DB_HOST=127.0.0.1
DB_HOST=127.0.0.1
RABBIT_HOST=rabbitmq.default.svc.cluster.local
RABBIT_PORT=5672
RABBIT_LOGIN=rabbitmq
RABBIT_PASSWORD=senthink123!
RABBIT_VHOST=cdz_gateway
\ No newline at end of file
.idea/workspace.xml
View file @
53b82674
This diff is collapsed.
Click to expand it.
Lib/rabbitmq/MyRabbitMq.php
View file @
53b82674
...
@@ -8,25 +8,13 @@
...
@@ -8,25 +8,13 @@
namespace
Lib\rabbitmq
;
namespace
Lib\rabbitmq
;
use
Lib\Env
;
use
Log
;
use
Log
;
class
MyRabbitMq
class
MyRabbitMq
{
{
const
CONNECTION
=
[
'host'
=>
'rabbitmq.default.svc.cluster.local'
,
'port'
=>
'5672'
,
'login'
=>
'rabbitmq'
,
'password'
=>
'senthink123!'
,
'vhost'
=>
'cdz_gateway'
,
];
/**
/**
* @var \AMQPConnection
* @var \AMQPConnection
...
@@ -60,7 +48,18 @@ class MyRabbitMq
...
@@ -60,7 +48,18 @@ class MyRabbitMq
*/
*/
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
connection
=
new
\AMQPConnection
(
self
::
CONNECTION
);
$this
->
connection
=
new
\AMQPConnection
([
'host'
=>
Env
::
get
(
'RABBIT_HOST'
),
'port'
=>
Env
::
get
(
'RABBIT_PORT'
),
'login'
=>
Env
::
get
(
'RABBIT_LOGIN'
),
'password'
=>
Env
::
get
(
'RABBIT_PASSWORD'
),
'vhost'
=>
Env
::
get
(
'RABBIT_VHOST'
),
]);
if
(
!
$this
->
connection
->
connect
())
{
if
(
!
$this
->
connection
->
connect
())
{
...
@@ -83,7 +82,7 @@ class MyRabbitMq
...
@@ -83,7 +82,7 @@ class MyRabbitMq
* @return \AMQPChannel
* @return \AMQPChannel
* @throws \AMQPConnectionException
* @throws \AMQPConnectionException
*/
*/
public
function
getChannel
()
:
\AMQPChannel
public
function
getChannel
()
:
\AMQPChannel
{
{
return
$this
->
channel
=
new
\AMQPChannel
(
$this
->
connection
);
return
$this
->
channel
=
new
\AMQPChannel
(
$this
->
connection
);
...
...
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