mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
开始自动更新架构
This commit is contained in:
@@ -10,6 +10,8 @@ use think\facade\Event;
|
|||||||
use think\facade\Filesystem;
|
use think\facade\Filesystem;
|
||||||
use think\route\Url;
|
use think\route\Url;
|
||||||
|
|
||||||
|
include_once __DIR__ . '/app/common/app/functions.php';
|
||||||
|
|
||||||
if (!function_exists('__url')) {
|
if (!function_exists('__url')) {
|
||||||
/**
|
/**
|
||||||
* 构建URL地址
|
* 构建URL地址
|
||||||
|
|||||||
1
app/common/app/functions.php
Normal file
1
app/common/app/functions.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?php
|
||||||
5
app/common/app/middleware.php
Normal file
5
app/common/app/middleware.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
5
app/common/app/service.php
Normal file
5
app/common/app/service.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
@@ -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);
|
$event['listen'] = array_merge($event['listen'], $listen);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// 全局中间件定义文件
|
// 全局中间件定义文件
|
||||||
return [
|
|
||||||
|
$middleware_default = [
|
||||||
// 全局请求缓存
|
// 全局请求缓存
|
||||||
// \think\middleware\CheckRequestCache::class,
|
// \think\middleware\CheckRequestCache::class,
|
||||||
// 多语言加载
|
// 多语言加载
|
||||||
// \think\middleware\LoadLangPack::class,
|
// \think\middleware\LoadLangPack::class,
|
||||||
// Session初始化
|
// 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);
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ use app\common\provider\ExceptionHandle;
|
|||||||
use app\common\provider\Request;
|
use app\common\provider\Request;
|
||||||
use app\common\provider\View;
|
use app\common\provider\View;
|
||||||
|
|
||||||
return [
|
$provider_default = [
|
||||||
'think\Request' => Request::class,
|
'think\Request' => Request::class,
|
||||||
'think\exception\Handle' => ExceptionHandle::class,
|
'think\exception\Handle' => ExceptionHandle::class,
|
||||||
'think\View' => View::class,
|
'think\View' => View::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$provider_common = include_once __DIR__ . '/app/common/app/provider.php';
|
||||||
|
|
||||||
|
return array_merge($provider_default, $provider_common);
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
declare (strict_types=1);
|
|
||||||
|
|
||||||
return [
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
$service_default = [
|
||||||
0 => 'think\\captcha\\CaptchaService',
|
0 => 'think\\captcha\\CaptchaService',
|
||||||
1 => 'think\\app\\Service',
|
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
14
config/update.php
Normal 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;
|
||||||
Reference in New Issue
Block a user