webmcp

changeset 209:2cb27106aa73

Removed functions request.get_config, request.get_app_basepath, request.get_app_name
author jbe
date Sat Jan 10 00:19:38 2015 +0100 (2015-01-10)
parents 2c2bcde0df79
children 474cf0cfb85b
files framework/bin/mcp.lua framework/env/encode/action_file_path.lua framework/env/encode/view_file_path.lua framework/env/execute/view.lua framework/env/locale/_get_translation_table.lua framework/env/request/get_app_basepath.lua framework/env/request/get_app_name.lua framework/env/request/get_config_name.lua framework/env/slot/render_layout.lua framework/env/tempstore/pop.lua framework/env/tempstore/save.lua
line diff
     1.1 --- a/framework/bin/mcp.lua	Sat Jan 10 00:11:52 2015 +0100
     1.2 +++ b/framework/bin/mcp.lua	Sat Jan 10 00:19:38 2015 +0100
     1.3 @@ -220,14 +220,6 @@
     1.4  local success, error_info = xpcall(
     1.5    function()
     1.6  
     1.7 -    -- execute configuration file
     1.8 -    do
     1.9 -      local config_name = request.get_config_name()
    1.10 -      if config_name then
    1.11 -        execute.config(config_name)
    1.12 -      end
    1.13 -    end
    1.14 -
    1.15      -- restore slots if coming from http redirect
    1.16      if cgi.params.tempstore then
    1.17        trace.restore_slots{}
     2.1 --- a/framework/env/encode/action_file_path.lua	Sat Jan 10 00:11:52 2015 +0100
     2.2 +++ b/framework/env/encode/action_file_path.lua	Sat Jan 10 00:19:38 2015 +0100
     2.3 @@ -11,9 +11,9 @@
     2.4  
     2.5  function encode.action_file_path(args)
     2.6    return (encode.file_path(
     2.7 -    request.get_app_basepath(),
     2.8 +    WEBMCP_BASE_PATH,
     2.9      'app',
    2.10 -    request.get_app_name(),
    2.11 +    WEBMCP_APP_NAME,
    2.12      args.module,
    2.13      '_action',
    2.14      args.action .. '.lua'
     3.1 --- a/framework/env/encode/view_file_path.lua	Sat Jan 10 00:11:52 2015 +0100
     3.2 +++ b/framework/env/encode/view_file_path.lua	Sat Jan 10 00:19:38 2015 +0100
     3.3 @@ -11,7 +11,6 @@
     3.4  
     3.5  function encode.view_file_path(args)
     3.6    return (encode.file_path(
     3.7 -    request.get_app_basepath(),
     3.8 -    'app', request.get_app_name(), args.module, args.view .. '.lua'
     3.9 +    WEBMCP_BASE_PATH, 'app', WEBMCP_APP_NAME, args.module, args.view .. '.lua'
    3.10    ))
    3.11  end
     4.1 --- a/framework/env/execute/view.lua	Sat Jan 10 00:11:52 2015 +0100
     4.2 +++ b/framework/env/execute/view.lua	Sat Jan 10 00:19:38 2015 +0100
     4.3 @@ -16,7 +16,7 @@
     4.4    trace.enter_view{ module = module, view = view }
     4.5    execute.file_path{
     4.6      file_path = encode.file_path(
     4.7 -      WEBMCP_BASE_PATH, 'app', request.get_app_name(), module, view .. '.lua'
     4.8 +      WEBMCP_BASE_PATH, 'app', WEBMCP_APP_NAME, module, view .. '.lua'
     4.9      ),
    4.10      id     = args.id,
    4.11      params = args.params
     5.1 --- a/framework/env/locale/_get_translation_table.lua	Sat Jan 10 00:11:52 2015 +0100
     5.2 +++ b/framework/env/locale/_get_translation_table.lua	Sat Jan 10 00:19:38 2015 +0100
     5.3 @@ -8,7 +8,7 @@
     5.4      if translation_table then 
     5.5        return translation_table
     5.6      end
     5.7 -    local filename = encode.file_path(request.get_app_basepath(), "locale", "translations." .. language_code .. ".lua")
     5.8 +    local filename = encode.file_path(WEBMCP_BASE_PATH, "locale", "translations." .. language_code .. ".lua")
     5.9      local func
    5.10      if _ENV then
    5.11        func = assert(loadfile(filename), nil, {})
     6.1 --- a/framework/env/request/get_app_basepath.lua	Sat Jan 10 00:11:52 2015 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,11 +0,0 @@
     6.4 ---[[--
     6.5 -path =                      -- path to directory of application with trailing slash
     6.6 -request.get_app_basepath()
     6.7 -
     6.8 -This function returns the path to the base directory of the application. A trailing slash is always included.
     6.9 -
    6.10 ---]]--
    6.11 -
    6.12 -function request.get_app_basepath()
    6.13 -  return request._app_basepath
    6.14 -end
     7.1 --- a/framework/env/request/get_app_name.lua	Sat Jan 10 00:11:52 2015 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,11 +0,0 @@
     7.4 ---[[--
     7.5 -app_name =
     7.6 -request.get_app_name()
     7.7 -
     7.8 -Returns the application name set by the environment variable 'WEBMCP_APP_NAME', or "main" as default application name, if the environment variable is unset.
     7.9 -
    7.10 ---]]--
    7.11 -
    7.12 -function request.get_app_name()
    7.13 -  return os.getenv("WEBMCP_APP_NAME") or 'main'
    7.14 -end
     8.1 --- a/framework/env/request/get_config_name.lua	Sat Jan 10 00:11:52 2015 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,11 +0,0 @@
     8.4 ---[[--
     8.5 -config_name =
     8.6 -request.get_config_name()
     8.7 -
     8.8 -Returns the name of the configuration selected by the environment variable 'WEBMCP_CONFIG_NAME', or nil if the environment variable is not set.
     8.9 -
    8.10 ---]]--
    8.11 -
    8.12 -function request.get_config_name()
    8.13 -  return os.getenv("WEBMCP_CONFIG_NAME")
    8.14 -end
    8.15 \ No newline at end of file
     9.1 --- a/framework/env/slot/render_layout.lua	Sat Jan 10 00:11:52 2015 +0100
     9.2 +++ b/framework/env/slot/render_layout.lua	Sat Jan 10 00:19:38 2015 +0100
     9.3 @@ -10,9 +10,9 @@
     9.4    if slot._current_layout then
     9.5      local layout_file = assert(io.open(
     9.6        encode.file_path(
     9.7 -        request.get_app_basepath(),
     9.8 +        WEBMCP_BASE_PATH,
     9.9          'app',
    9.10 -        request.get_app_name(),
    9.11 +        WEBMCP_APP_NAME,
    9.12          '_layout',
    9.13          slot._current_layout .. '.html'
    9.14        ),
    10.1 --- a/framework/env/tempstore/pop.lua	Sat Jan 10 00:11:52 2015 +0100
    10.2 +++ b/framework/env/tempstore/pop.lua	Sat Jan 10 00:19:38 2015 +0100
    10.3 @@ -10,7 +10,7 @@
    10.4  
    10.5  function tempstore.pop(key)
    10.6    local filename = encode.file_path(
    10.7 -    request.get_app_basepath(), 'tmp', "tempstore-" .. key .. ".tmp"
    10.8 +    WEBMCP_BASE_PATH, 'tmp', "tempstore-" .. key .. ".tmp"
    10.9    )
   10.10    local file = io.open(filename, "r")
   10.11    if not file then return nil end
    11.1 --- a/framework/env/tempstore/save.lua	Sat Jan 10 00:11:52 2015 +0100
    11.2 +++ b/framework/env/tempstore/save.lua	Sat Jan 10 00:19:38 2015 +0100
    11.3 @@ -11,10 +11,10 @@
    11.4  function tempstore.save(blob)
    11.5    local key = multirand.string(26, "123456789bcdfghjklmnpqrstvwxyz");
    11.6    local filename = encode.file_path(
    11.7 -    request.get_app_basepath(), 'tmp', "tempstore-" .. key .. ".tmp"
    11.8 +    WEBMCP_BASE_PATH, 'tmp', "tempstore-" .. key .. ".tmp"
    11.9    )
   11.10    local file = assert(io.open(filename, "w"))
   11.11    file:write(blob)
   11.12    io.close(file)
   11.13    return key
   11.14 -end
   11.15 \ No newline at end of file
   11.16 +end

Impressum / About Us