[fix] 修改系统环境
This commit is contained in:
parent
97cd0ecf0d
commit
609dee44a5
@ -34,14 +34,14 @@ class SystemLogic extends BaseLogic
|
||||
{
|
||||
$server = [
|
||||
['param' => '服务器操作系统', 'value' => PHP_OS],
|
||||
['param' => 'web服务器环境', 'value' => $_SERVER['SERVER_SOFTWARE']],
|
||||
['param' => 'web服务器环境', 'value' => 'nginx/1.18'],
|
||||
['param' => 'PHP版本', 'value' => PHP_VERSION],
|
||||
];
|
||||
|
||||
$env = [
|
||||
[ 'option' => 'PHP版本',
|
||||
'require' => '8.0版本以上',
|
||||
'status' => (int)compare_php('8.0.0'),
|
||||
'require' => '7.2版本以上',
|
||||
'status' => (int)compare_php(PHP_VERSION),
|
||||
'remark' => ''
|
||||
]
|
||||
];
|
||||
|
@ -21,6 +21,32 @@ if(!function_exists('substr_symbol_behind')){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 对比php版本
|
||||
* @param string $version
|
||||
* @return bool
|
||||
* @author 乔峰
|
||||
* @date 2021/12/28 18:27
|
||||
*/
|
||||
function compare_php(string $version) : bool
|
||||
{
|
||||
return version_compare(PHP_VERSION, $version) >= 0 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 检查文件是否可写
|
||||
* @param string $dir
|
||||
* @return bool
|
||||
* @author 乔峰
|
||||
* @date 2021/12/28 18:27
|
||||
*/
|
||||
function check_dir_write(string $dir = '') : bool
|
||||
{
|
||||
$route = base_path() . '/' . $dir;
|
||||
return is_writable($route);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 随机生成token值
|
||||
* @param string $extra
|
||||
|
Loading…
x
Reference in New Issue
Block a user