Skip to content

Commit

Permalink
环境变量读取增强 (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft authored Dec 11, 2021
1 parent 1be0a38 commit a3246b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions example/TCPServer/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

use function Imi\env;

return [
// 项目根命名空间
'namespace' => 'Imi\SwooleTracker\Example\TCPServer',
Expand Down Expand Up @@ -113,7 +115,7 @@
],
],
'resource' => [
'host' => imiGetEnv('REDIS_SERVER_HOST', '127.0.0.1'),
'host' => env('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => 6379,
'password' => null,
],
Expand All @@ -127,7 +129,7 @@
],
],
'resource' => [
'host' => imiGetEnv('REDIS_SERVER_HOST', '127.0.0.1'),
'host' => env('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => 6379,
'password' => null,
],
Expand Down
14 changes: 8 additions & 6 deletions example/WebSocketServer/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

use function Imi\env;

return [
// 项目根命名空间
'namespace' => 'Imi\SwooleTracker\Example\WebSocketServer',
Expand Down Expand Up @@ -48,9 +50,9 @@
],
],
'resource' => [
'host' => imiGetEnv('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('REDIS_SERVER_PORT', 6379),
'password' => imiGetEnv('REDIS_SERVER_PASSWORD'),
'host' => env('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => env('REDIS_SERVER_PORT', 6379),
'password' => env('REDIS_SERVER_PASSWORD'),
],
],
'async' => [
Expand All @@ -62,9 +64,9 @@
],
],
'resource' => [
'host' => imiGetEnv('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('REDIS_SERVER_PORT', 6379),
'password' => imiGetEnv('REDIS_SERVER_PASSWORD'),
'host' => env('REDIS_SERVER_HOST', '127.0.0.1'),
'port' => env('REDIS_SERVER_PORT', 6379),
'password' => env('REDIS_SERVER_PASSWORD'),
],
],
],
Expand Down

0 comments on commit a3246b0

Please sign in to comment.