Config
Last updated
Last updated
For detailed explanation, please see document.
Name
Type
Explanation
Example
router
obj
Router(Request Method、Path、Handler、Middlewares)
See below
server
obj
Swoole Server Config
See below
redis
obj
Redis Config
See below
mysql
obj
MySQL Config
See below
log
obj
Log Config
See below
elasticsearch
obj
Elasticsearch Config
See below
middleware
array
Global Middlewares
[\App\middlewares\Cors::class]
cors
obj
Cross Domain Config
See below
storage
obj
Storage System Config
See below
timezone
string
Default Timezone
\App\components\Helper::env('TIMEZONE', 'PRC')
monitor
obj
Runtime Monitor Config
See below
amqp
obj
AMQP Protocol Config
See below
events
obj
Events & Listeners
Please see Events
Name
Type
Explanation
Example
single
array
Router(Request Method、Path、Handler、Middlewares)
['GET', '/redis', [\App\services\DemoService::class, 'redis', [\App\middlewares\Cors::class]]]
group
obj
Group Router
Please see Router
Name
Type
Explanation
Example
host
string
Swoole Listening Host
127.0.0.1
port
int
Swoole Listening Port
9501
reactor_num
int
Swoole Reactor Thread Number
8
worker_num
int
Swoole Worker Process Number
32
daemonize
bool
Swoole Daemon Mode Switch
false
backlog
int
TCP Backlog Size
128
max_request
int
Swoole Worker Max Request
0
dispatch_mode
int
Swoole Request Dispatch Mode
2
Name
Type
Explanation
Example
host
string
Redis Server Host
127.0.0.1
port
int
Redis Server Port
6379
timeout
double
Redis Connection Timeout
1
pool_size
int
Redis Connection Pool Size
5
passwd
string
Redis Auth Password
null
db
int
Redis DB Index
0
switch
int
Redis Component Switch
0
prefix
string
Redis Key Prefix
sw-fw-less:
pool_change_event
int
Redis Pool Change Event
0
report_pool_change
int
Whether to report redis pool change event
0
Name
Type
Explanation
Example
dsn
string
username
string
passwd
string
options
obj
pool_size
int
switch
int
pool_change_event
int
report_pool_change
int
Name
Type
Explanation
Example
path
string
level
int
pool_size
int
buffer_max_size
int
name
string
reserve_days
int
switch
int
Name
Type
Explanation
Example
connections
obj
Please see Elasticsearch
switch
int
Name
Type
Explanation
Example
origin
string
switch
int
Name
Type
Explanation
Example
base_path
string
switch
int
storage_path
string
types
array
['file', 'qiniu', 'alioss']
ext
obj
Please see Storage
Name
Type
Explanation
Example
switch
int
Monitor API Switch
0
Name
Type
Explanation
Example
pool_size
int
switch
int
prefix
string
channel_id
int
host
string
port
int
user
string
passwd
string
vhost
string
locale
read_timeout
keepalive
write_timeout
heartbeat
pool_change_event
report_pool_change
Name
Type
Explanation
Example
SERVER_HOST
SERVER_PORT
SERVER_REACTOR_NUM
SERVER_WORKER_NUM
SERVER_DAEMONIZE
SERVER_BACKLOG
SERVER_MAX_REQUEST
SERVER_DISPATCH_MODE
REDIS_HOST
REDIS_PORT
REDIS_TIMEOUT
REDIS_POOL_SIZE
REDIS_PASSWD
REDIS_DB
REDIS_SWITCH
REDIS_PREFIX
MYSQL_DSN
MYSQL_USERNAME
MYSQL_PASSWD
MYSQL_POOL_SIZE
MYSQL_SWITCH
LOG_PATH
LOG_LEVEL
LOG_POOL_SIZE
LOG_BUFFER_MAX_SIZE
LOG_NAME
LOG_RESERVE_DAYS
LOG_SWITCH
ES_DEFAULT_HOST
ES_SWITCH
ES_TIMEOUT
CORS_ORIGIN
CORS_SWITCH
APP_BASE_PATH
STORAGE_SWITCH
STORAGE_PATH
STORAGE_TYPES
QINIU_DEFAULT_BUCKET
QINIU_DEFAULT_ACCESS_KEY
QINIU_DEFAULT_SECRET_KEY
QINIU_DEFAULT_DOMAIN
TIMEZONE
MONITOR_SWITCH