Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4f3796fa
authored
Apr 30, 2021
by
杜文军
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
环境变量
parent
a998c550
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
config/define.php
config/define.php
View file @
4f3796fa
...
...
@@ -12,10 +12,14 @@ define('STATUS_ILLEGAL_PARAM',300); //操作被拒绝,可能是参数不合法
define
(
'STATUS_ERROR'
,
400
);
//列表的数据已被穷尽,没有更多数据
define
(
'STATUS_UNKNOWN'
,
500
);
//服务器未知错误
$EnvLoader
=
new
Loader
(
dirname
(
$_SERVER
[
'DOCUMENT_ROOT'
]
)
.
'/.env'
);
$EnvLoader
->
load
();
$RESOURCE_CONFIG_DIR
=
$EnvLoader
->
getEnvironmentVariable
(
"RESOURCE_CONFIG_DIR"
);
$APP_STORAGE_PATH
=
$EnvLoader
->
getEnvironmentVariable
(
"APP_STORAGE_PATH"
);
$default_env_file
=
dirname
(
$_SERVER
[
'DOCUMENT_ROOT'
]
)
.
'/.env'
;
$RESOURCE_CONFIG_DIR
=
$APP_STORAGE_PATH
=
''
;
if
(
file_exists
(
$default_env_file
)){
$EnvLoader
=
new
Loader
(
$default_env_file
);
$EnvLoader
->
load
();
$RESOURCE_CONFIG_DIR
=
$EnvLoader
->
getEnvironmentVariable
(
"RESOURCE_CONFIG_DIR"
);
$APP_STORAGE_PATH
=
$EnvLoader
->
getEnvironmentVariable
(
"APP_STORAGE_PATH"
);
}
// 定义资源配置文件目录
define
(
'RESOURCE_CONFIG_DIR'
,
(
$RESOURCE_CONFIG_DIR
)
?
$RESOURCE_CONFIG_DIR
:
'/data2/liexin_config'
);
...
...
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