配置了MariaDB的远程DB数据库,由于原始程序无法正确截取版本号,需要做相应的调整后才能正常安装,具体方法如下:
找到app\install\controller\Index.php文件,打开后定位505行,将505到511行注释掉。
// $mysql_version = str_replace('-log', '', $data[0]['version']);
// if($mysql_version < $this->charset_type_list[$db_charset]['version'])
// {
// $msg = '数据库版本过低、需要>='.$this->charset_type_list[$db_charset]['version'].'、当前'.$mysql_version;
// $this->behavior_obj->ReportInstallLog(['msg'=>$msg, 'mysql_version'=>$mysql_version]);
// return DataReturn($msg, -1);
// }在511行之后添加以下内容。
preg_match('/\d+\.\d+\.\d+/', $data[0]['version'], $matches);
$mysql_version = isset($matches[0]) ? $matches[0] : null;
if(empty($mysql_version)) {
$this->behavior_obj->ReportInstallLog(['msg'=>'数据库版本解析失败:'.$data[0]['version']]);
return DataReturn('数据库版本解析失败', -1);
}
if (version_compare($mysql_version, $this->charset_type_list[$db_charset]['version'], '<')) {
$msg = '数据库版本过低、需要>=' . $this->charset_type_list[$db_charset]['version'] . '、当前' . $mysql_version;
$this->behavior_obj->ReportInstallLog(['msg'=>$msg, 'mysql_version'=>$mysql_version]);
return DataReturn($msg, -1);
}您好,感谢您的反馈,已按照您提供的代码修复,将在下一个版本中发布。
查看全部 0 条评论