# HG changeset patch # User jbe # Date 1420845578 -3600 # Node ID 2cb27106aa73414f3759f98ead597361348f3d6e # Parent 2c2bcde0df796e8441eda7d0346332ddd2fe9c0c Removed functions request.get_config, request.get_app_basepath, request.get_app_name diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/bin/mcp.lua --- a/framework/bin/mcp.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/bin/mcp.lua Sat Jan 10 00:19:38 2015 +0100 @@ -220,14 +220,6 @@ local success, error_info = xpcall( function() - -- execute configuration file - do - local config_name = request.get_config_name() - if config_name then - execute.config(config_name) - end - end - -- restore slots if coming from http redirect if cgi.params.tempstore then trace.restore_slots{} diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/encode/action_file_path.lua --- a/framework/env/encode/action_file_path.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/encode/action_file_path.lua Sat Jan 10 00:19:38 2015 +0100 @@ -11,9 +11,9 @@ function encode.action_file_path(args) return (encode.file_path( - request.get_app_basepath(), + WEBMCP_BASE_PATH, 'app', - request.get_app_name(), + WEBMCP_APP_NAME, args.module, '_action', args.action .. '.lua' diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/encode/view_file_path.lua --- a/framework/env/encode/view_file_path.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/encode/view_file_path.lua Sat Jan 10 00:19:38 2015 +0100 @@ -11,7 +11,6 @@ function encode.view_file_path(args) return (encode.file_path( - request.get_app_basepath(), - 'app', request.get_app_name(), args.module, args.view .. '.lua' + WEBMCP_BASE_PATH, 'app', WEBMCP_APP_NAME, args.module, args.view .. '.lua' )) end diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/execute/view.lua --- a/framework/env/execute/view.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/execute/view.lua Sat Jan 10 00:19:38 2015 +0100 @@ -16,7 +16,7 @@ trace.enter_view{ module = module, view = view } execute.file_path{ file_path = encode.file_path( - WEBMCP_BASE_PATH, 'app', request.get_app_name(), module, view .. '.lua' + WEBMCP_BASE_PATH, 'app', WEBMCP_APP_NAME, module, view .. '.lua' ), id = args.id, params = args.params diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/locale/_get_translation_table.lua --- a/framework/env/locale/_get_translation_table.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/locale/_get_translation_table.lua Sat Jan 10 00:19:38 2015 +0100 @@ -8,7 +8,7 @@ if translation_table then return translation_table end - local filename = encode.file_path(request.get_app_basepath(), "locale", "translations." .. language_code .. ".lua") + local filename = encode.file_path(WEBMCP_BASE_PATH, "locale", "translations." .. language_code .. ".lua") local func if _ENV then func = assert(loadfile(filename), nil, {}) diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/request/get_app_basepath.lua --- a/framework/env/request/get_app_basepath.lua Sat Jan 10 00:11:52 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---[[-- -path = -- path to directory of application with trailing slash -request.get_app_basepath() - -This function returns the path to the base directory of the application. A trailing slash is always included. - ---]]-- - -function request.get_app_basepath() - return request._app_basepath -end diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/request/get_app_name.lua --- a/framework/env/request/get_app_name.lua Sat Jan 10 00:11:52 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---[[-- -app_name = -request.get_app_name() - -Returns the application name set by the environment variable 'WEBMCP_APP_NAME', or "main" as default application name, if the environment variable is unset. - ---]]-- - -function request.get_app_name() - return os.getenv("WEBMCP_APP_NAME") or 'main' -end diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/request/get_config_name.lua --- a/framework/env/request/get_config_name.lua Sat Jan 10 00:11:52 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---[[-- -config_name = -request.get_config_name() - -Returns the name of the configuration selected by the environment variable 'WEBMCP_CONFIG_NAME', or nil if the environment variable is not set. - ---]]-- - -function request.get_config_name() - return os.getenv("WEBMCP_CONFIG_NAME") -end \ No newline at end of file diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/slot/render_layout.lua --- a/framework/env/slot/render_layout.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/slot/render_layout.lua Sat Jan 10 00:19:38 2015 +0100 @@ -10,9 +10,9 @@ if slot._current_layout then local layout_file = assert(io.open( encode.file_path( - request.get_app_basepath(), + WEBMCP_BASE_PATH, 'app', - request.get_app_name(), + WEBMCP_APP_NAME, '_layout', slot._current_layout .. '.html' ), diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/tempstore/pop.lua --- a/framework/env/tempstore/pop.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/tempstore/pop.lua Sat Jan 10 00:19:38 2015 +0100 @@ -10,7 +10,7 @@ function tempstore.pop(key) local filename = encode.file_path( - request.get_app_basepath(), 'tmp', "tempstore-" .. key .. ".tmp" + WEBMCP_BASE_PATH, 'tmp', "tempstore-" .. key .. ".tmp" ) local file = io.open(filename, "r") if not file then return nil end diff -r 2c2bcde0df79 -r 2cb27106aa73 framework/env/tempstore/save.lua --- a/framework/env/tempstore/save.lua Sat Jan 10 00:11:52 2015 +0100 +++ b/framework/env/tempstore/save.lua Sat Jan 10 00:19:38 2015 +0100 @@ -11,10 +11,10 @@ function tempstore.save(blob) local key = multirand.string(26, "123456789bcdfghjklmnpqrstvwxyz"); local filename = encode.file_path( - request.get_app_basepath(), 'tmp', "tempstore-" .. key .. ".tmp" + WEBMCP_BASE_PATH, 'tmp', "tempstore-" .. key .. ".tmp" ) local file = assert(io.open(filename, "w")) file:write(blob) io.close(file) return key -end \ No newline at end of file +end