add update tips
This commit is contained in:
parent
6a8cbc97e2
commit
e119ba073c
|
|
@ -5,6 +5,16 @@
|
||||||
|
|
||||||
<p>数据库升级成功,欢迎使用 Blessing Skin Server {{ config('app.version') }}!</p>
|
<p>数据库升级成功,欢迎使用 Blessing Skin Server {{ config('app.version') }}!</p>
|
||||||
|
|
||||||
|
{{-- if any tip is given --}}
|
||||||
|
@if (isset($tips))
|
||||||
|
<p><b>升级提示:</b></p>
|
||||||
|
<ul>
|
||||||
|
@foreach ($tips as $tip)
|
||||||
|
<li><p>{{ $tip }}</p></li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
|
||||||
<p class="step">
|
<p class="step">
|
||||||
<a href="../" class="button button-large">首页</a>
|
<a href="../" class="button button-large">首页</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ switch ($step) {
|
||||||
case '2':
|
case '2':
|
||||||
$resource = opendir(BASE_DIR."/setup/update_scripts/");
|
$resource = opendir(BASE_DIR."/setup/update_scripts/");
|
||||||
$update_script_exist = false;
|
$update_script_exist = false;
|
||||||
|
|
||||||
|
$tips = [];
|
||||||
|
|
||||||
while($filename = @readdir($resource)) {
|
while($filename = @readdir($resource)) {
|
||||||
if ($filename != "." && $filename != "..") {
|
if ($filename != "." && $filename != "..") {
|
||||||
preg_match('/update-(.*)-to-(.*).php/', $filename, $matches);
|
preg_match('/update-(.*)-to-(.*).php/', $filename, $matches);
|
||||||
|
|
@ -31,7 +34,14 @@ switch ($step) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
include BASE_DIR."/setup/update_scripts/$filename";
|
$result = require BASE_DIR."/setup/update_scripts/$filename";
|
||||||
|
|
||||||
|
if (is_array($result)) {
|
||||||
|
// push tip to array
|
||||||
|
foreach ($result as $tip) {
|
||||||
|
$tips[] = $tip;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($resource);
|
closedir($resource);
|
||||||
|
|
@ -46,7 +56,7 @@ switch ($step) {
|
||||||
Option::set('version', config('app.version'));
|
Option::set('version', config('app.version'));
|
||||||
}
|
}
|
||||||
|
|
||||||
View::show('setup.updates.success');
|
View::show('setup.updates.success', ['tips' => $tips]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user