liquid_feedback_frontend

diff config/default.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children dd0109e81922
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/default.lua	Wed Nov 18 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +config.app_name = "LiquidFeedback"
     1.5 +config.app_version = "alpha1"
     1.6 +
     1.7 +config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     1.8 +
     1.9 +config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany"
    1.10 +
    1.11 +-- uncomment the following two lines to use C implementations of chosen
    1.12 +-- functions and to disable garbage collection during the request, to
    1.13 +-- increase speed:
    1.14 +--
    1.15 +-- require 'webmcp_accelerator'
    1.16 +-- collectgarbage("stop")
    1.17 +
    1.18 +-- open and set default database handle
    1.19 +db = assert(mondelefant.connect{
    1.20 +  engine='postgresql',
    1.21 +  dbname='liquid_feedback'
    1.22 +})
    1.23 +at_exit(function() 
    1.24 +  db:close()
    1.25 +end)
    1.26 +function mondelefant.class_prototype:get_db_conn() return db end
    1.27 +
    1.28 +-- enable output of SQL commands in trace system
    1.29 +function db:sql_tracer(command)
    1.30 +  return function(error_info)
    1.31 +    local error_info = error_info or {}
    1.32 +    trace.sql{ command = command, error_position = error_info.position }
    1.33 +  end
    1.34 +end
    1.35 +
    1.36 +-- 'request.get_relative_baseurl()' should be replaced by the absolute
    1.37 +-- base URL of the application, as otherwise HTTP redirects will not be
    1.38 +-- standard compliant
    1.39 +request.set_absolute_baseurl(request.get_relative_baseurl())
    1.40 +
    1.41 +
    1.42 +
    1.43 +
    1.44 +-- get record by id
    1.45 +function mondelefant.class_prototype:by_id(id)
    1.46 +  local selector = self:new_selector()
    1.47 +  selector:add_where{ 'id = ?', id }
    1.48 +  selector:optional_object_mode()
    1.49 +  return selector:exec()
    1.50 +end
    1.51 +

Impressum / About Us