feat: config
This commit is contained in:
30
config/autoload/ali.php
Normal file
30
config/autoload/ali.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
// 阿里云 accessKeyId
|
||||
'access_key_id' => env('ALI_ACCESS_KEY_ID', ''),
|
||||
// 阿里云 accessKeySecret
|
||||
'access_key_secret' => env('ALI_ACCESS_KEY_SECRET', ''),
|
||||
// 阿里云 oss bucket
|
||||
'bucket' => env('ALI_BUCKET', ''),
|
||||
// 阿里云 oss region
|
||||
'region' => env('ALI_REGION', 'cn-shenzhen'),
|
||||
// 阿里云 oss 临时上传目录
|
||||
'upload_dir' => env('ALI_UPLOAD_DIR', ''),
|
||||
// 阿里云 oss 回调地址
|
||||
'callback_url' => env('ALI_CALLBACK_URL', ''),
|
||||
// 阿里云 oss 外网访问地址
|
||||
'oss_url' => env('ALI_OSS_URL', ''),
|
||||
];
|
||||
18
config/autoload/crontab.php
Normal file
18
config/autoload/crontab.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
//是否开启定时任务
|
||||
'enable' => env('CRONTAB_ENABLE', false),
|
||||
];
|
||||
@@ -9,6 +9,8 @@ declare(strict_types=1);
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
use Hyperf\ModelCache\Handler\RedisHandler;
|
||||
use function Hyperf\Support\env;
|
||||
|
||||
return [
|
||||
@@ -37,5 +39,14 @@ return [
|
||||
'inheritance' => 'Model',
|
||||
],
|
||||
],
|
||||
'cache' => [
|
||||
'handler' => RedisHandler::class,
|
||||
'cache_key' => 'mc:%s:m:%s:%s:%s',
|
||||
'prefix' => 'default',
|
||||
'ttl' => 3600 * 24,
|
||||
'empty_model_ttl' => 3600,
|
||||
'load_script' => true,
|
||||
'use_default_value' => false,
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
@@ -26,4 +26,32 @@ return [
|
||||
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
|
||||
],
|
||||
],
|
||||
'system' => [
|
||||
'host' => env('REDIS_HOST', 'localhost'),
|
||||
'auth' => env('REDIS_AUTH', null),
|
||||
'port' => (int) env('REDIS_PORT', 6379),
|
||||
'db' => (int) env('SYSTEM_REDIS_DB', 1),
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 10,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
|
||||
],
|
||||
],
|
||||
'lock' => [
|
||||
'host' => env('REDIS_HOST', 'localhost'),
|
||||
'auth' => env('REDIS_AUTH', null),
|
||||
'port' => (int) env('REDIS_PORT', 6379),
|
||||
'db' => (int) env('LOCK_REDIS_DB', 2),
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 10,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user