mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:00:55 +00:00
beego: support other config provider
This commit is contained in:
parent
23229ef9ef
commit
a2a6f47afa
@ -70,6 +70,7 @@ var (
|
|||||||
AdminHttpPort int
|
AdminHttpPort int
|
||||||
FlashName string // name of the flash variable found in response header and cookie
|
FlashName string // name of the flash variable found in response header and cookie
|
||||||
FlashSeperator string // used to seperate flash key:value
|
FlashSeperator string // used to seperate flash key:value
|
||||||
|
AppConfigProvider string // config provider
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -91,6 +92,8 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppConfigProvider = "ini"
|
||||||
|
|
||||||
StaticDir = make(map[string]string)
|
StaticDir = make(map[string]string)
|
||||||
StaticDir["/static"] = "static"
|
StaticDir["/static"] = "static"
|
||||||
|
|
||||||
@ -170,7 +173,7 @@ func init() {
|
|||||||
// ParseConfig parsed default config file.
|
// ParseConfig parsed default config file.
|
||||||
// now only support ini, next will support json.
|
// now only support ini, next will support json.
|
||||||
func ParseConfig() (err error) {
|
func ParseConfig() (err error) {
|
||||||
AppConfig, err = config.NewConfig("ini", AppConfigPath)
|
AppConfig, err = config.NewConfig(AppConfigProvider, AppConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
AppConfig = config.NewFakeConfig()
|
AppConfig = config.NewFakeConfig()
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user