webmcp

changeset 439:29b1f7a04934

Updated documentation
author jbe
date Fri Feb 05 01:26:00 2016 +0100 (2016-02-05)
parents ea8419658535
children 66d7a0ac9c9d
files doc/autodoc-header.htmlpart framework/bin/mcp.lua
line diff
     1.1 --- a/doc/autodoc-header.htmlpart	Wed Jan 20 21:06:07 2016 +0100
     1.2 +++ b/doc/autodoc-header.htmlpart	Fri Feb 05 01:26:00 2016 +0100
     1.3 @@ -143,6 +143,15 @@
     1.4        </li>
     1.5      </ol>
     1.6      </p>
     1.7 +    <p>
     1.8 +      As a minimum configuration, the used configuration file or pre-fork initializer should at least contain a <tt>listen{...}</tt> call, e.g.:
     1.9 +    </p>
    1.10 +    <pre>
    1.11 +listen{
    1.12 +  { proto = "tcp", host = "::", port = 8080 },
    1.13 +  { proto = "tcp", host = "0.0.0.0", port = 8080 }
    1.14 +}
    1.15 +execute.inner()  -- if done in pre-fork initializer</pre>
    1.16      <h2>Using the atom library</h2>
    1.17      <p>
    1.18        Lua itself has only very few built-in data types. The atom library gives support for extra data types. Currently the following extra data types are provided:
    1.19 @@ -173,14 +182,14 @@
    1.20        The library &ldquo;mondelefant&rdquo; shipping with WebMCP can be used to access PostgreSQL databases. It also serves as an Object-Relational Mapper (ORM). The database connection is usually configured in the config file (e.g. in <tt>config/devel.lua</tt>):
    1.21      </p>
    1.22      <pre>
    1.23 -config.db = { engine="postgresql", dbname="webmcp_demo" }
    1.24 -config.db_trace = true</pre>
    1.25 +config.db = { engine="postgresql", dbname="webmcp_demo" }</pre>
    1.26      <p>
    1.27        In addition to configuring the database, it must be opened within a post-fork initializer (e.g. in <tt>app/_postfork/01_database.lua</tt>):
    1.28      </p>
    1.29      <pre>
    1.30  _G.db = assert(mondelefant.connect(config.db))
    1.31 -function mondelefant.class_prototype:get_db_conn() return db end</pre>
    1.32 +function mondelefant.class_prototype:get_db_conn() return db end
    1.33 +execute.inner()</pre>
    1.34      <p>
    1.35        The parameters for <tt>mondelefant.connect</tt> are directly passed to PostgreSQL's client library libpq. See <a href="http://www.postgresql.org/docs/9.4/static/libpq-connect.html">PostgreSQL's documentation on PQconnect</a> for information about supported parameters.
    1.36      </p>
     2.1 --- a/framework/bin/mcp.lua	Wed Jan 20 21:06:07 2016 +0100
     2.2 +++ b/framework/bin/mcp.lua	Fri Feb 05 01:26:00 2016 +0100
     2.3 @@ -290,10 +290,10 @@
     2.4  --[[--
     2.5  listen{
     2.6    {
     2.7 -    proto     = proto,            -- "local", "tcp4", "tcp6", or "interval"
     2.8 +    proto     = proto,            -- "local", "tcp", or "interval"
     2.9      path      = path,             -- path to unix domain socket if proto == "local"
    2.10      port      = port,             -- TCP port number
    2.11 -    localhost = localhost_only,   -- set to true to only listen on localhost (127.0.0.1 or ::1) interface
    2.12 +    host      = host,             -- "::" for all IPv6 interfaces, "0.0.0.0" for all IPv4 interfaces
    2.13      name      = interval_name,    -- optional interval name (may be useful for log output)
    2.14      handler   = interval_handler  -- interval handler if proto == "interval"
    2.15    },

Impressum / About Us