-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.php
75 lines (70 loc) · 2.53 KB
/
config.example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
use Core\Components\Cache;
use Core\Components\Config;
$cacheDir = Config::getEnv('AVATAR_CONFIG_CACHE_DIR', CACHE_DIR);
$config = [
'core' => [
'debug' => false,
'version' => VERSION . Config::currentGitCommit(GIT_DIR),
'node' => Config::getEnv('AVATAR_CONFIG_NODE', 'NodeName'),
'domain' => Config::getEnv('AVATAR_CONFIG_DOMAIN', 'http://avatar.test/'),
'handler' => [
'type' => \Core\HttpHandler\Swoole::class,
'options' => [
// work for swoole or anything similar
'listen' => Config::getEnv('AVATAR_CONFIG_HANDLER_LISTEN', '0.0.0.0'),
'port' => (int) Config::getEnv('AVATAR_CONFIG_HANDLER_PORT', 9000),
'config' => [ // Refer to https://wiki.swoole.com/wiki/page/274.html
'daemonize' => 0,
'task_worker_num' => Config::cpuNum() * 4,
'task_enable_coroutine' => true,
'worker_num' => Config::cpuNum() * 4,
'dispatch_mode' => 3,
'http_parse_post' => false,
'http_parse_cookie' => false,
'http_parse_files' => false
]
]
],
'logging' => [
'streams' => (PHP_SAPI === 'cli') ? [
fopen('php://stdout', 'w')
] : []
],
'cache' => [
// PSR-6 CacheItemPoolInterface
Cache::POOL_ANY => new \Stash\Pool(new \Stash\Driver\FileSystem([
'dirSplit' => 1,
'path' => $cacheDir
])),
Cache::POOL_META => new \Stash\Pool(new \Stash\Driver\FileSystem([
'dirSplit' => 1,
'path' => $cacheDir . 'meta/'
])),
Cache::POOL_DATA => new \Stash\Pool(new \Stash\Driver\FileSystem([
'dirSplit' => 1,
'path' => $cacheDir . 'data/'
]))
],
'rate-limit' => [
// WIP
'enabled' => false
]
],
'service' => [
'general' => [
'expire' => [
'meta' => 86400,
'data' => 2592000
]
],
'github' => [
// Custom config for every single service
// Example: (actually we don't need it, leave it blank)
'access_token' => ''
]
]
];
// Register Error Handler for master process
(new \Whoops\Run)->prependHandler(new \Whoops\Handler\PlainTextHandler())->register();
return $config;