Comp mysql 5.5. Add show alien config. Fix upload globally. Better the install process.

This commit is contained in:
zicla
2018-12-27 01:53:23 +08:00
parent 64ca363f96
commit e8a5a4a60b
31 changed files with 68 additions and 55 deletions

View File

@ -65,6 +65,9 @@ func (this *ConfigItem) validate() bool {
if this.ServerPort == 0 {
LOGGER.Error("ServerPort 未配置")
return false
} else {
//只要配置文件中有配置端口,就使用。
CONFIG.ServerPort = this.ServerPort
}
if this.MysqlUsername == "" {
@ -134,9 +137,10 @@ func (this *Config) ReadFromConfigFile() {
this.Installed = false
} else {
this.Item = &ConfigItem{}
LOGGER.Warn("读取配置文件:%s", filePath)
err := jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(content, this.Item)
if err != nil {
LOGGER.Error("配置文件格式错误!")
LOGGER.Error("配置文件格式错误! 即将进入安装过程!")
this.Installed = false
return
}
@ -144,7 +148,7 @@ func (this *Config) ReadFromConfigFile() {
//验证项是否齐全
itemValidate := this.Item.validate()
if !itemValidate {
LOGGER.Error("配置文件信息不齐全!")
LOGGER.Error("配置文件信息不齐全! 即将进入安装过程!")
this.Installed = false
return
}