feat: config
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.3",
|
"php": ">=8.3",
|
||||||
|
"alibabacloud/sts-20150401": "^1.1",
|
||||||
|
"aliyuncs/oss-sdk-php": "^2.7",
|
||||||
"firebase/php-jwt": "^6.10",
|
"firebase/php-jwt": "^6.10",
|
||||||
"hyperf/amqp": "~3.1.0",
|
"hyperf/amqp": "~3.1.0",
|
||||||
"hyperf/cache": "~3.1.0",
|
"hyperf/cache": "~3.1.0",
|
||||||
@@ -28,6 +30,7 @@
|
|||||||
"hyperf/http-server": "~3.1.0",
|
"hyperf/http-server": "~3.1.0",
|
||||||
"hyperf/logger": "~3.1.0",
|
"hyperf/logger": "~3.1.0",
|
||||||
"hyperf/memory": "~3.1.0",
|
"hyperf/memory": "~3.1.0",
|
||||||
|
"hyperf/model-cache": "^3.1",
|
||||||
"hyperf/paginator": "^3.1",
|
"hyperf/paginator": "^3.1",
|
||||||
"hyperf/process": "~3.1.0",
|
"hyperf/process": "~3.1.0",
|
||||||
"hyperf/redis": "~3.1.0",
|
"hyperf/redis": "~3.1.0",
|
||||||
|
|||||||
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
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Hyperf\ModelCache\Handler\RedisHandler;
|
||||||
use function Hyperf\Support\env;
|
use function Hyperf\Support\env;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -37,5 +39,14 @@ return [
|
|||||||
'inheritance' => 'Model',
|
'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),
|
'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