webmcp
diff framework/env/request/handler.lua @ 258:46f0083889a9
Initialize global variable 'app' on every request
author | jbe |
---|---|
date | Sun Mar 15 01:08:00 2015 +0100 (2015-03-15) |
parents | 9e4be058959d |
children | c3d539e33710 |
line diff
1.1 --- a/framework/env/request/handler.lua Sun Mar 15 01:06:04 2015 +0100 1.2 +++ b/framework/env/request/handler.lua Sun Mar 15 01:08:00 2015 +0100 1.3 @@ -19,6 +19,7 @@ 1.4 1.5 -- TODO: function incomplete yet 1.6 function request.handler(http_request) 1.7 + _G.app = {} -- may be overwritten or modified by request initializers 1.8 do 1.9 local first = not request._in_progress 1.10 request._in_progress = true -- NOTE: must be set to true before initializer functions are called 1.11 @@ -246,3 +247,15 @@ 1.12 end 1.13 1.14 end 1.15 + 1.16 +--//-- 1.17 + 1.18 +--[[-- 1.19 +app -- table to store an application state 1.20 + 1.21 +'app' is a global table for storing any application state data. It will be reset for every request. 1.22 +--]]-- 1.23 + 1.24 +-- Initialized in request.handler(...). 1.25 + 1.26 +--//--