Preprocess PHP version
This commit is contained in:
parent
d5205ede35
commit
050fa45993
|
|
@ -98,7 +98,9 @@ class UpdateController extends Controller
|
|||
$this->getUpdateInfo();
|
||||
|
||||
$php = Arr::get($this->info, 'php');
|
||||
if (Comparator::lessThan(PHP_VERSION, $php)) {
|
||||
preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches);
|
||||
$version = $matches[1];
|
||||
if (Comparator::lessThan($version, $php)) {
|
||||
$this->error = trans('admin.update.errors.php', ['version' => $php]);
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@
|
|||
exit($error);
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
|
||||
preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches);
|
||||
$version = $matches[1];
|
||||
if (version_compare($version, '7.2.0', '<')) {
|
||||
die_with_utf8_encoding(
|
||||
'[Error] Blessing Skin requires PHP version >= 7.2.0, you are now using '.PHP_VERSION.'<br>'.
|
||||
'[错误] 你的 PHP 版本过低('.PHP_VERSION.'),Blessing Skin 要求至少为 7.2.0'
|
||||
'[Error] Blessing Skin requires PHP version >= 7.2.0, you are now using '.$version.'<br>'.
|
||||
'[错误] 你的 PHP 版本过低('.$version.'),Blessing Skin 要求至少为 7.2.0'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user