开始自动更新架构

This commit is contained in:
2023-09-18 18:06:40 +08:00
parent c7426e4094
commit 01db0f9956
10 changed files with 53 additions and 7 deletions

View File

@@ -10,6 +10,8 @@ use think\facade\Event;
use think\facade\Filesystem;
use think\route\Url;
include_once __DIR__ . '/app/common/app/functions.php';
if (!function_exists('__url')) {
/**
* 构建URL地址

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,5 @@
<?php
return [
];

View File

@@ -0,0 +1,5 @@
<?php
return [
];

View File

@@ -27,7 +27,7 @@ $event = [
],
];
$listen = include __DIR__ . '/listen.php';
$listen = include __DIR__ . '/app/common/app/listen.php';
$event['listen'] = array_merge($event['listen'], $listen);

View File

@@ -1,10 +1,18 @@
<?php
// 全局中间件定义文件
return [
$middleware_default = [
// 全局请求缓存
// \think\middleware\CheckRequestCache::class,
// 多语言加载
// \think\middleware\LoadLangPack::class,
// Session初始化
\think\middleware\SessionInit::class
100 => \think\middleware\SessionInit::class,
];
$middleware_common = include_once __DIR__ . '/app/common/app/middleware.php';
$middleware = array_merge($middleware_default, $middleware_common);
return ksort($middleware);

View File

@@ -6,8 +6,12 @@ use app\common\provider\ExceptionHandle;
use app\common\provider\Request;
use app\common\provider\View;
return [
$provider_default = [
'think\Request' => Request::class,
'think\exception\Handle' => ExceptionHandle::class,
'think\View' => View::class,
];
$provider_common = include_once __DIR__ . '/app/common/app/provider.php';
return array_merge($provider_default, $provider_common);

View File

@@ -1,7 +1,14 @@
<?php
declare (strict_types=1);
return [
declare(strict_types=1);
$service_default = [
0 => 'think\\captcha\\CaptchaService',
1 => 'think\\app\\Service',
];
$service_common = include_once __DIR__ . '/app/common/app/service.php';
$service = array_merge($service_default, $service_common);
return ksort($service);

14
config/update.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
$config = [];
$skip_files = [];
$skip_files[] = '/app/common/app/functions.php';
$skip_files[] = '/app/common/app/listen.php';
$skip_files[] = '/app/common/app/middleware.php';
$skip_files[] = '/app/common/app/service.php';
$config['skip_files'] = $skip_files;
return $config;