新增环境变量管理工具genv,完善gmvc配置管理功能

This commit is contained in:
John 2017-12-18 11:07:44 +08:00
parent 6ee93e7414
commit ef59098989
4 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 john@johng.cn
Copyright (c) 2017 john@johng.cn http://johng.cn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -7,7 +7,7 @@ go get -u gitee.com/johng/gf
## 使用
```go
import "gitee.com/johng/gf/g/xxx"
import "gitee.com/johng/gf/g/xxx/xxx"
```
## 说明

View File

@ -103,6 +103,15 @@ func (p *Json) GetMap(pattern string) map[string]interface{} {
return nil
}
// 将检索值转换为Json对象指针返回
func (p *Json) GetJson(pattern string) *Json {
result := p.Get(pattern)
if result != nil {
return &Json{&result}
}
return nil
}
// 获得一个数组[]interface{},方便操作,不需要自己做类型转换
// 注意如果获取的值不存在或者类型与json类型不匹配那么将会返回nil
func (p *Json) GetArray(pattern string) []interface{} {

View File

@ -3,14 +3,10 @@ package gbase
import (
"gitee.com/johng/gf/g/os/gfile"
"gitee.com/johng/gf/g/os/gconsole"
"gitee.com/johng/gf/g/database/gdb"
"gitee.com/johng/gf/g/frame/gconfig"
"gitee.com/johng/gf/g/frame/ginstance"
"gitee.com/johng/gf/g/os/gconsole"
)
const (
gDEFAULT_CONFIG_FILE = "config.json" // 默认读取的配置文件名称
)
// 框架基类所有的基于gf框架的类对象都继承于此以便使用框架的一些封装的核心组件