Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
fenzhan_zsb
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esf
fenzhan_zsb
Commits
dfcb41cc
Commit
dfcb41cc
authored
Jul 22, 2020
by
yaoyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加测试环境的判断
parent
1b2eab83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
database.php
new_admincp/applications/zsb/config/database.php
+2
-2
index.php
new_admincp/index.php
+11
-0
No files found.
new_admincp/applications/zsb/config/database.php
View file @
dfcb41cc
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
$IpHostAllow
=
explode
(
'.'
,
GetIp
());
$IpHostAllow
=
explode
(
'.'
,
GetIp
());
$server_ip
=
$_SERVER
[
'SERVER_ADDR'
];
$server_ip
=
$_SERVER
[
'SERVER_ADDR'
];
//if($IpHostAllow['0']=='192' || $IpHostAllow['0']=='127')
//if($IpHostAllow['0']=='192' || $IpHostAllow['0']=='127')
if
(
$server_ip
==
'192.168.105.107'
)
if
(
IS_ENV_TEST
||
$server_ip
==
'192.168.105.107'
)
{
{
$host_city_nj
=
'192.168.105.243'
;
$host_city_nj
=
'192.168.105.243'
;
if
(
GB_CITY
==
'nj'
)
if
(
GB_CITY
==
'nj'
)
...
@@ -331,7 +331,7 @@ if($server_ip =='192.168.105.107')
...
@@ -331,7 +331,7 @@ if($server_ip =='192.168.105.107')
//从库轮询
//从库轮询
$nowtime
=
date
(
'G'
);
$nowtime
=
date
(
'G'
);
$dbback_hostname
=
'1
72.17.1.50'
;
$dbback_hostname
=
'1
92.168.105.243'
;
// 172.17.1.50无
法连接
//从库
//从库
$db
[
'dbback'
][
'hostname'
]
=
$dbback_hostname
;
$db
[
'dbback'
][
'hostname'
]
=
$dbback_hostname
;
...
...
new_admincp/index.php
View file @
dfcb41cc
...
@@ -21,6 +21,17 @@
...
@@ -21,6 +21,17 @@
//DEBUG模式
//DEBUG模式
isset
(
$_COOKIE
[
'admin_debug'
])
&&
$_COOKIE
[
'admin_debug'
]
==
1
?
define
(
'ENVIRONMENT'
,
'development'
)
:
define
(
'ENVIRONMENT'
,
'production'
);
isset
(
$_COOKIE
[
'admin_debug'
])
&&
$_COOKIE
[
'admin_debug'
]
==
1
?
define
(
'ENVIRONMENT'
,
'development'
)
:
define
(
'ENVIRONMENT'
,
'production'
);
//define('ENVIRONMENT', 'development');
//define('ENVIRONMENT', 'development');
if
(
$_COOKIE
[
'admin_debug'
]
||
preg_match
(
'/^(192|127).*$/i'
,
$_SERVER
[
'SERVER_ADDR'
])
){
// 本地/测试环境
// error_reporting(E_ALL);
// ini_set('display_errors', true);
defined
(
'IS_ENV_TEST'
)
or
define
(
'IS_ENV_TEST'
,
true
);
// 是否本地/测试环境
defined
(
'IS_ENV_PROD'
)
or
define
(
'IS_ENV_PROD'
,
false
);
// 是否线上环境
}
else
{
// 线上环境
defined
(
'IS_ENV_TEST'
)
or
define
(
'IS_ENV_TEST'
,
false
);
defined
(
'IS_ENV_PROD'
)
or
define
(
'IS_ENV_PROD'
,
true
);
}
/*
/*
*---------------------------------------------------------------
*---------------------------------------------------------------
* ERROR REPORTING
* ERROR REPORTING
...
...
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