1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00
This commit is contained in:
Unknown
2014-05-25 20:11:25 -04:00
parent 87854c95a9
commit 688ec6ecbd
37 changed files with 693 additions and 482 deletions

View File

@@ -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)