diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-25 20:11:25 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-25 20:11:25 -0400 |
commit | 688ec6ecbdf0e1c450aa93fdc4d760c4ae63a73f (patch) | |
tree | 8adb59c369d1fe1bd41ae7be38785dc613a29a91 /models/models.go | |
parent | 87854c95a90cf1bebe1bffb833389471fb35f234 (diff) | |
download | gitea-688ec6ecbdf0e1c450aa93fdc4d760c4ae63a73f.tar.gz gitea-688ec6ecbdf0e1c450aa93fdc4d760c4ae63a73f.zip |
Fixed #209
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/models/models.go b/models/models.go index 841b10639d..c9fb0a4cbf 100644 --- a/models/models.go +++ b/models/models.go @@ -14,7 +14,7 @@ import ( "github.com/go-xorm/xorm" _ "github.com/lib/pq" - "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/setting" ) var ( @@ -39,16 +39,16 @@ func init() { } func LoadModelsConfig() { - DbCfg.Type = base.Cfg.MustValue("database", "DB_TYPE") + DbCfg.Type = setting.Cfg.MustValue("database", "DB_TYPE") if DbCfg.Type == "sqlite3" { UseSQLite3 = true } - DbCfg.Host = base.Cfg.MustValue("database", "HOST") - DbCfg.Name = base.Cfg.MustValue("database", "NAME") - DbCfg.User = base.Cfg.MustValue("database", "USER") - DbCfg.Pwd = base.Cfg.MustValue("database", "PASSWD") - DbCfg.SslMode = base.Cfg.MustValue("database", "SSL_MODE") - DbCfg.Path = base.Cfg.MustValue("database", "PATH", "data/gogs.db") + DbCfg.Host = setting.Cfg.MustValue("database", "HOST") + DbCfg.Name = setting.Cfg.MustValue("database", "NAME") + DbCfg.User = setting.Cfg.MustValue("database", "USER") + DbCfg.Pwd = setting.Cfg.MustValue("database", "PASSWD") + DbCfg.SslMode = setting.Cfg.MustValue("database", "SSL_MODE") + DbCfg.Path = setting.Cfg.MustValue("database", "PATH", "data/gogs.db") } func NewTestEngine(x *xorm.Engine) (err error) { @@ -112,8 +112,8 @@ func SetEngine() (err error) { // WARNNING: for serv command, MUST remove the output to os.stdout, // so use log file to instead print to stdout. - execDir, _ := base.ExecDir() - logPath := execDir + "/log/xorm.log" + workDir, _ := setting.WorkDir() + logPath := workDir + "/log/xorm.log" os.MkdirAll(path.Dir(logPath), os.ModePerm) f, err := os.Create(logPath) |