mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 05:11:31 +00:00
move assignment to init
This commit is contained in:
parent
09d3d89c6f
commit
d1481ea659
10
config.go
10
config.go
@ -113,9 +113,15 @@ var (
|
|||||||
TemplateCache map[string]*template.Template
|
TemplateCache map[string]*template.Template
|
||||||
// GlobalSessions is the instance for the session manager
|
// GlobalSessions is the instance for the session manager
|
||||||
GlobalSessions *session.Manager
|
GlobalSessions *session.Manager
|
||||||
|
|
||||||
|
workPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
AppPath, _ = filepath.Abs(filepath.Dir(os.Args[0]))
|
||||||
|
workPath, _ = os.Getwd()
|
||||||
|
workPath, _ = filepath.Abs(workPath)
|
||||||
|
|
||||||
BConfig = &Config{
|
BConfig = &Config{
|
||||||
AppName: "beego",
|
AppName: "beego",
|
||||||
RunMode: DEV,
|
RunMode: DEV,
|
||||||
@ -181,10 +187,6 @@ 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) {
|
||||||
AppPath, _ := filepath.Abs(filepath.Dir(os.Args[0]))
|
|
||||||
workPath, _ := os.Getwd()
|
|
||||||
workPath, _ = filepath.Abs(workPath)
|
|
||||||
|
|
||||||
if AppConfigPath == "" {
|
if AppConfigPath == "" {
|
||||||
// initialize default configurations
|
// initialize default configurations
|
||||||
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
|
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
|
||||||
|
Loading…
Reference in New Issue
Block a user