diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-07 17:22:15 -0500 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-07 17:22:15 -0500 |
commit | 5a05d6633d413b1c5182a0a542e173f99601a103 (patch) | |
tree | b6d343ca8c998909839d1364f466f7af223fdd1b /models | |
parent | a2a59f8ad1192d3504abd50b2daf2ebfd97c86ca (diff) | |
download | gitea-5a05d6633d413b1c5182a0a542e173f99601a103.tar.gz gitea-5a05d6633d413b1c5182a0a542e173f99601a103.zip |
Merge utils to modules
Diffstat (limited to 'models')
-rw-r--r-- | models/models.go | 18 | ||||
-rw-r--r-- | models/repo.go | 3 | ||||
-rw-r--r-- | models/user.go | 6 |
3 files changed, 14 insertions, 13 deletions
diff --git a/models/models.go b/models/models.go index 0dee65478f..e0ab3ca15a 100644 --- a/models/models.go +++ b/models/models.go @@ -12,7 +12,7 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/lunny/xorm" - "github.com/gogits/gogs/utils" + "github.com/gogits/gogs/modules/base" ) var ( @@ -41,11 +41,11 @@ type Comment struct { } func setEngine() { - dbType := utils.Cfg.MustValue("database", "DB_TYPE") - dbHost := utils.Cfg.MustValue("database", "HOST") - dbName := utils.Cfg.MustValue("database", "NAME") - dbUser := utils.Cfg.MustValue("database", "USER") - dbPwd := utils.Cfg.MustValue("database", "PASSWD") + dbType := base.Cfg.MustValue("database", "DB_TYPE") + dbHost := base.Cfg.MustValue("database", "HOST") + dbName := base.Cfg.MustValue("database", "NAME") + dbUser := base.Cfg.MustValue("database", "USER") + dbPwd := base.Cfg.MustValue("database", "PASSWD") uname, err := user.Current() if err != nil { @@ -54,7 +54,7 @@ func setEngine() { } if uname.Username == "jiahuachen" { - dbPwd = utils.Cfg.MustValue("database", "PASSWD_jiahua") + dbPwd = base.Cfg.MustValue("database", "PASSWD_jiahua") } switch dbType { @@ -82,9 +82,9 @@ func setEngine() { //log.Trace("Initialized database -> %s", dbName) - RepoRootPath = utils.Cfg.MustValue("repository", "ROOT") + RepoRootPath = base.Cfg.MustValue("repository", "ROOT") if uname.Username == "jiahuachen" { - RepoRootPath = utils.Cfg.MustValue("repository", "ROOT_jiahuachen") + RepoRootPath = base.Cfg.MustValue("repository", "ROOT_jiahuachen") } } diff --git a/models/repo.go b/models/repo.go index 04e8c75c1b..22b98e7975 100644 --- a/models/repo.go +++ b/models/repo.go @@ -10,8 +10,9 @@ import ( "strings" "time" - "github.com/gogits/gogs/utils/log" git "github.com/libgit2/git2go" + + "github.com/gogits/gogs/modules/log" ) type Repo struct { diff --git a/models/user.go b/models/user.go index 36cdfc8a43..d904304f51 100644 --- a/models/user.go +++ b/models/user.go @@ -14,13 +14,13 @@ import ( "github.com/dchest/scrypt" - "github.com/gogits/gogs/utils" + "github.com/gogits/gogs/modules/base" ) var UserPasswdSalt string func init() { - UserPasswdSalt = utils.Cfg.MustValue("security", "USER_PASSWD_SALT") + UserPasswdSalt = base.Cfg.MustValue("security", "USER_PASSWD_SALT") } // User types. @@ -115,7 +115,7 @@ func RegisterUser(user *User) (err error) { } user.LowerName = strings.ToLower(user.Name) - user.Avatar = utils.EncodeMd5(user.Email) + user.Avatar = base.EncodeMd5(user.Email) if err = user.EncodePasswd(); err != nil { return err } |