Merry Christmas: version 12.1.3 released

Former-commit-id: d4c9538646b8c17b32bc49b911e1535bcfe55401
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-12-25 13:12:20 +02:00
parent 05100770f0
commit 5f92475dea
8 changed files with 45 additions and 42 deletions

View File

@ -21,6 +21,10 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
**How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest`.
# We, 25 December 2019 | v12.1.3
Fix [[BUG] [iris.Default] RegisterView](https://github.com/kataras/iris/issues/1410)
# Th, 19 December 2019 | v12.1.2
Fix [[BUG]Session works incorrectly when meets the multi-level TLDs](https://github.com/kataras/iris/issues/1407).

View File

@ -21,17 +21,9 @@ Los desarrolladores no están obligados a actualizar si realmente no lo necesita
**Cómo actualizar**: Abra su línea de comandos y ejecute este comando: `go get github.com/kataras/iris/v12@latest`.
# Th, 19 December 2019 | v12.1.2
# We, 25 December 2019 | v12.1.3
Not translated yet, please navigate to the [english version](HISTORY.md#th-19-december-2019--v1212) instead.
# Mo, 16 December 2019 | v12.1.1
Not translated yet, please navigate to the [english version](HISTORY.md#mo-16-december-2019--v1211) instead.
# Fr, 13 December 2019 | v12.1.0
Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead.
Not translated yet, please navigate to the [english version](HISTORY.md#we-25-december-2019--v1213) instead.
# Sábado, 26 de octubre 2019 | v12.0.0

View File

@ -1,6 +1,6 @@
# ![](https://iris-go.com/images/santa.png) Merry Christmas everyone!
![](https://iris-go.com/images/release.png) Iris version 12.1.2 has been [released](HISTORY.md#th-19-december-2019--v1212)!
![](https://iris-go.com/images/release.png) Iris version 12.1.3 has been [released](HISTORY.md#we-25-december-2019--v1213)!
![](https://iris-go.com/images/cli.png) The official Iris Command Line Interface will soon be near you in 2020!

View File

@ -1 +1 @@
12.1.2:https://github.com/kataras/iris/releases/tag/v12.1.2
12.1.3:https://github.com/kataras/iris/releases/tag/v12.1.3

View File

@ -4,5 +4,5 @@ go 1.13
require (
github.com/betacraft/yaag v1.0.1-0.20191027021412-565f65e36090
github.com/kataras/iris/v12 v12.1.2
github.com/kataras/iris/v12 v12.1.3
)

View File

@ -4,5 +4,5 @@ go 1.13
require (
github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 // indirect
github.com/kataras/iris/v12 v12.1.2
github.com/kataras/iris/v12 v12.1.3
)

2
doc.go
View File

@ -38,7 +38,7 @@ Source code and other details for the project are available at GitHub:
Current Version
12.1.2
12.1.3
Installation

61
iris.go
View File

@ -39,7 +39,7 @@ import (
)
// Version is the current version number of the Iris Web Framework.
const Version = "12.1.2"
const Version = "12.1.3"
// HTTP status codes as registered with IANA.
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
@ -154,7 +154,8 @@ type Application struct {
// view engine
view view.View
// used for build
builded bool
builded bool
defaultMode bool
mu sync.Mutex
// Hosts contains a list of all servers (Host Supervisors) that this app is running on.
@ -188,36 +189,14 @@ func New() *Application {
return app
}
// Default returns a new Application instance which preloads
// html view engine on "./views" and
// locales from "./locales/*/*" filepath glob pattern by current working directory.
// Default returns a new Application instance which on build state registers
// html view engine on "./views" and load locales from "./locales/*/*".
// The return instance recovers on panics and logs the incoming http requests too.
func Default() *Application {
app := New()
app.Use(recover.New())
app.Use(requestLogger.New())
for _, s := range []string{"./locales/*/*", "./locales/*", "./translations"} {
if _, err := os.Stat(s); os.IsNotExist(err) {
continue
}
if err := app.I18n.Load(s); err != nil {
continue
}
app.I18n.SetDefault("en-US")
break
}
for _, s := range []string{"./views", "./templates", "./web/views"} {
if _, err := os.Stat(s); os.IsNotExist(err) {
continue
}
app.RegisterView(HTML(s, ".html"))
break
}
app.defaultMode = true
return app
}
@ -860,6 +839,34 @@ func (app *Application) Build() error {
app.builded = true
rp.Err(app.APIBuilder.GetReporter())
if app.defaultMode { // the app.I18n and app.View will be not available until Build.
if !app.I18n.Loaded() {
for _, s := range []string{"./locales/*/*", "./locales/*", "./translations"} {
if _, err := os.Stat(s); os.IsNotExist(err) {
continue
}
if err := app.I18n.Load(s); err != nil {
continue
}
app.I18n.SetDefault("en-US")
break
}
}
if app.view.Len() == 0 {
for _, s := range []string{"./views", "./templates", "./web/views"} {
if _, err := os.Stat(s); os.IsNotExist(err) {
continue
}
app.RegisterView(HTML(s, ".html"))
break
}
}
}
if app.I18n.Loaded() {
// {{ tr "lang" "key" arg1 arg2 }}
app.view.AddFunc("tr", app.I18n.Tr)