diff --git a/app/Services/Boot.php b/app/Services/Boot.php index bd62628d..da6fa77f 100644 --- a/app/Services/Boot.php +++ b/app/Services/Boot.php @@ -59,6 +59,12 @@ class Boot if (!is_dir(BASE_DIR.'/textures/')) { throw new E("检测到 `textures` 文件夹已被删除,请重新运行 安装程序,或者手动放置一个。", -1, true); } + + if (Application::getVersion() != @Option::get('version')) { + Http::redirect(Http::getBaseUrl().'/setup/update.php'); + exit; + } + return true; } diff --git a/config/app.php b/config/app.php index b4165a64..2907b7e3 100644 --- a/config/app.php +++ b/config/app.php @@ -8,6 +8,6 @@ | */ return [ - 'version' => '3.0.1', + 'version' => '3.0.2', 'locale' => 'zh-cn' ]; diff --git a/resources/views/setup/updates/master.tpl b/resources/views/setup/updates/master.tpl new file mode 100644 index 00000000..9204b3a1 --- /dev/null +++ b/resources/views/setup/updates/master.tpl @@ -0,0 +1,19 @@ + + + + + + + Blessing Skin Server 升级程序 + + + + + + + +@yield('content') + + + + diff --git a/resources/views/setup/updates/success.tpl b/resources/views/setup/updates/success.tpl new file mode 100644 index 00000000..647204ed --- /dev/null +++ b/resources/views/setup/updates/success.tpl @@ -0,0 +1,11 @@ +@extends('setup.updates.master') + +@section('content') +

升级成功

+ +

数据库升级成功,欢迎使用 Blessing Skin Server {{ App::getVersion() }}!

+ +

+ 首页 +

+@endsection diff --git a/resources/views/setup/updates/welcome.tpl b/resources/views/setup/updates/welcome.tpl new file mode 100644 index 00000000..e9f05790 --- /dev/null +++ b/resources/views/setup/updates/welcome.tpl @@ -0,0 +1,12 @@ +@extends('setup.updates.master') + +@section('content') +

还差一小步

+ +

欢迎升级至 Blessing Skin Server {{ App::getVersion() }}!

+

我们需要升级您的数据库,点击下一步以继续。

+ +

+ 下一步 +

+@endsection diff --git a/setup/update.php b/setup/update.php new file mode 100644 index 00000000..0b7106fb --- /dev/null +++ b/setup/update.php @@ -0,0 +1,64 @@ +