diff --git a/apps/index.lua b/apps/index.lua index 74e4524..0401b1f 100644 --- a/apps/index.lua +++ b/apps/index.lua @@ -1,8 +1,3 @@ --- require needed library -require("silk.api") --- need to define this --- basically it initialize an session object -session_start() -- some global variables DIR_SEP = "" @@ -11,6 +6,13 @@ HTTP_ROOT = "" MODEL_ROOT = "" CONTROLLER_ROOT = "" VIEW_ROOT = "" +BASE_FRW = "apps." + +-- require needed library +require("silk.api") +-- need to define this +-- basically it initialize an session object +session_start() -- registry object store global variables local REGISTRY = {} @@ -23,4 +25,5 @@ local router = Router{registry = REGISTRY} REGISTRY.router = router router.setPath(CONTROLLER_ROOT) router.delegate() +if REGISTRY.db then REGISTRY.db:close() end diff --git a/apps/silk/Logger.lua b/apps/silk/Logger.lua index fe7f360..66eb0ee 100644 --- a/apps/silk/Logger.lua +++ b/apps/silk/Logger.lua @@ -1,4 +1,4 @@ -Logger = Object:extends{registry = {}, levels = {}} +Logger = Object:extends{levels = {}} function Logger:initialize() end diff --git a/apps/silk/api.lua b/apps/silk/api.lua index f986fb8..c54bc2a 100644 --- a/apps/silk/api.lua +++ b/apps/silk/api.lua @@ -1,10 +1,10 @@ require("OOP") require("sqlite") -require("silk.Router") -require("silk.BaseController") -require("silk.BaseModel") -require("silk.Logger") -require("silk.Template") +require(BASE_FRW.."silk.Router") +require(BASE_FRW.."silk.BaseController") +require(BASE_FRW.."silk.BaseModel") +require(BASE_FRW.."silk.Logger") +require(BASE_FRW.."silk.Template") function Object:extends(o) return self:inherit(o)