Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
fb6312a3
Commit
fb6312a3
authored
Dec 04, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reverse from pull 330
parent
3c91360d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
beego.go
beego.go
+9
-1
config.go
config.go
+4
-17
No files found.
beego.go
View file @
fb6312a3
...
...
@@ -67,7 +67,15 @@ func InsertFilter(pattern string, pos int, filter FilterFunc) *App {
}
func
Run
()
{
InitConfig
()
//if AppConfigPath not In the conf/app.conf reParse config
if
AppConfigPath
!=
path
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
{
err
:=
ParseConfig
()
if
err
!=
nil
{
if
RunMode
==
"dev"
{
Warn
(
err
)
}
}
}
if
SessionOn
{
GlobalSessions
,
_
=
session
.
NewManager
(
SessionProvider
,
...
...
config.go
View file @
fb6312a3
...
...
@@ -58,9 +58,9 @@ var (
AdminHttpPort
int
)
func
InitConfig
()
{
// explicit call config.Init
func
init
()
{
os
.
Chdir
(
path
.
Dir
(
os
.
Args
[
0
]))
BeeApp
=
NewApp
()
AppPath
=
path
.
Dir
(
os
.
Args
[
0
])
StaticDir
=
make
(
map
[
string
]
string
)
TemplateCache
=
make
(
map
[
string
]
*
template
.
Template
)
...
...
@@ -83,6 +83,7 @@ func InitConfig() {
MaxMemory
=
1
<<
26
//64MB
EnableGzip
=
false
StaticDir
[
"/static"
]
=
"static"
AppConfigPath
=
path
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
HttpServerTimeOut
=
0
ErrorsShow
=
true
XSRFKEY
=
"beegoxsrf"
...
...
@@ -93,17 +94,7 @@ func InitConfig() {
EnableAdmin
=
true
AdminHttpAddr
=
"localhost"
AdminHttpPort
=
8088
// if AppConfigPath hasn't been set yet,
// use /Path/to/AppPath/conf/app.conf as the default
if
AppConfigPath
==
""
{
AppConfigPath
=
path
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
}
if
err
:=
ParseConfig
();
err
!=
nil
{
panic
(
err
)
}
ParseConfig
()
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
}
...
...
@@ -267,7 +258,3 @@ func ParseConfig() (err error) {
}
return
nil
}
func
init
()
{
BeeApp
=
NewApp
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment