初始化本地仓库

This commit is contained in:
2026-08-31 11:33:59 +08:00
commit 663f74b633
2390 changed files with 402918 additions and 0 deletions
@@ -0,0 +1,5 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,5 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,21 @@
<?php
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
return [
'enable' => true,
/**
* 扩展自定义验证规则
*/
'extends' => function (ValidationFactory $validator): void {
// 注册手机号验证规则
$validator->extend('mobile', function ($attribute, $value, $parameters) {
return preg_match('/^1[3-9]\d{9}$/', $value);
}, '无效的手机号码');
// 注册手机号验证规则(别名)
$validator->extend('phone', function ($attribute, $value, $parameters) {
return preg_match('/^1[3-9]\d{9}$/', $value);
}, '无效的手机号码');
}
];
@@ -0,0 +1,59 @@
<?php
use OpenApi\Annotations as OAA;
use OpenApi\Attributes as OA;
return [
/**
* 全局开关
*/
'enable' => true,
/**
* 全局扫描的配置
*
* @see \WebmanTech\Swagger\Swagger::registerGlobalRoute()
* @see \WebmanTech\Swagger\DTO\ConfigRegisterRouteDTO
*/
'global_route' => [
'register_route' => false,
'enable' => false,
'openapi_doc' => [
'scan_path' => [
],
],
],
/**
* 全局的 host forbidden 配置
*
* @see \WebmanTech\Swagger\DTO\ConfigHostForbiddenDTO
*/
'host_forbidden' => [
'enable' => true,
'host_white_list' => [],
],
/**
* 全局的 swagger ui 配置
*
* @see \WebmanTech\Swagger\DTO\ConfigSwaggerUiDTO
*/
'swagger_ui' => [
],
/**
* 全局的 openapi doc 配置
*
* @see \WebmanTech\Swagger\DTO\ConfigOpenapiDocDTO
*/
'openapi_doc' => [
'scan_path' => function () {
},
'scan_exclude' => [
],
'modify' => function (OAA\OpenApi $openapi) {
},
],
];
@@ -0,0 +1,3 @@
<?php
\WebmanTech\Swagger\Swagger::create()->registerGlobalRoute();
@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,29 @@
<?php
use Symfony\Component\Lock\Store\FlockStore;
use Symfony\Component\Lock\Store\RedisStore;
return [
'storage' => 'file', // file/redis, 建议使用 redis,file 不支持 ttl
'storage_configs' => [
'file' => [
'class' => FlockStore::class,
'construct' => [
'lockPath' => runtime_path() . '/lock',
],
],
'redis' => [
'class' => RedisStore::class,
'construct' => function() {
return [
'redis' => \support\Redis::connection('default')->client(),
];
},
],
],
'default_config' => [
'ttl' => 300, // 默认锁超时时间
'auto_release' => true, // 是否自动释放,建议设置为 true
'prefix' => 'lock_', // 锁前缀
],
];