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
9df7088c
authored
Apr 25, 2021
by
duwenjun
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'feature/wenjun/20210425_env' into 'master'
可以在env中自定义资源和日志路径 See merge request
!2
parents
5296b55c
b0044b14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
config/define.php
config/define.php
View file @
9df7088c
<?php
<?php
use
Dotenv\Loader
;
/*
/*
* 自定义全局变量
* 自定义全局变量
*/
*/
...
@@ -10,8 +12,13 @@ define('STATUS_ILLEGAL_PARAM',300); //操作被拒绝,可能是参数不合法
...
@@ -10,8 +12,13 @@ define('STATUS_ILLEGAL_PARAM',300); //操作被拒绝,可能是参数不合法
define
(
'STATUS_ERROR'
,
400
);
//列表的数据已被穷尽,没有更多数据
define
(
'STATUS_ERROR'
,
400
);
//列表的数据已被穷尽,没有更多数据
define
(
'STATUS_UNKNOWN'
,
500
);
//服务器未知错误
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"
);
// 定义资源配置文件目录
// 定义资源配置文件目录
define
(
'RESOURCE_CONFIG_DIR'
,
'/data2/liexin_config'
);
define
(
'RESOURCE_CONFIG_DIR'
,
(
$RESOURCE_CONFIG_DIR
)
?
$RESOURCE_CONFIG_DIR
:
'/data2/liexin_config'
);
// 定义日志目录
// 定义日志目录
define
(
'APP_STORAGE_PATH'
,
'/data2/liexin_logs/frq_api'
);
define
(
'APP_STORAGE_PATH'
,
(
$APP_STORAGE_PATH
)
?
$APP_STORAGE_PATH
:
'/data2/liexin_logs/frq_api'
);
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