webmcp
annotate framework/env/request/initialize.lua @ 351:b1748c6c3c89
extos.stat(...) returns false (instead of nil) if file does not exist; Added extos.lstat(...) and extos.fstat(...)
| author | jbe |
|---|---|
| date | Thu Mar 26 16:38:30 2015 +0100 (2015-03-26) |
| parents | e3e2a03f75b2 |
| children | 545ec2e3eafa |
| rev | line source |
|---|---|
| jbe@316 | 1 --[[-- |
| jbe@316 | 2 request.initialize() |
| jbe@316 | 3 |
| jbe@316 | 4 Executes all request initializers. Request initializers are added (and executed) using the request.for_each(...) call. Calling request.configure(...) before invoking request.initialize() for the first time also adds a request initializer. |
| jbe@316 | 5 |
| jbe@316 | 6 --]]-- |
| jbe@316 | 7 function request.initialize() |
| jbe@316 | 8 _G.app = {} -- may be overwritten or modified by request initializers |
| jbe@316 | 9 do |
| jbe@316 | 10 request._in_progress = true -- NOTE: must be set to true before initializer functions are called |
| jbe@316 | 11 for i, func in ipairs(request._initializers) do |
| jbe@316 | 12 func() |
| jbe@316 | 13 end |
| jbe@316 | 14 end |
| jbe@316 | 15 end |
| jbe@320 | 16 --//-- |
| jbe@320 | 17 |
| jbe@320 | 18 --[[-- |
| jbe@320 | 19 app -- table to store an application state |
| jbe@320 | 20 |
| jbe@320 | 21 'app' is a global table for storing any application state data. It will be reset for every request. |
| jbe@320 | 22 --]]-- |
| jbe@320 | 23 |
| jbe@320 | 24 -- Initialized in request.initialize(...). |
| jbe@320 | 25 |
| jbe@320 | 26 --//-- |