summaryrefslogtreecommitdiffstats
path: root/app/acf_cli-controller.lua
blob: 672af2516148c48cce6957d4885d85847fd079f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module(..., package.seeall)

-- We use the parent exception handler in a last-case situation
local parent_exception_handler

mvc = {}
mvc.on_load = function (self, parent)
	
	-- Make sure we have some kind of sane defaults for libdir and sessiondir
	self.conf.libdir = self.conf.libdir or ( self.conf.appdir .. "/lib/" )
	self.conf.sessiondir = self.conf.sessiondir or "/tmp/"
	self.conf.script = ""
	self.conf.default_controller = "welcome"	

	parent_exception_handler = parent.exception_handler
	
	-- this sets the package path for us and our children
	package.path=  self.conf.libdir .. "?.lua;" .. package.path
	require ("cfe")

	self.session = {}
	local x=require("session")
end

mvc.pre_exec = function ()
end

mvc.post_exec = function ()
end


view_resolver = function(self)
    return function (viewtable)
        print(viewtable)
    end
end

exception_handler = function (self, message )
    print(message)
end

-- syslog something
logit = function ( ... )
	os.execute ( "logger \"" .. ... .. "\"" )
end