summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_lua.xml
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2011-09-23 15:36:39 +0200
committerJim Jagielski <jim@apache.org>2011-09-23 15:36:39 +0200
commit69c1a5c854b89a80cf5ca08b7b38d9f0a88c2667 (patch)
tree304a1e7196cfcd252ab9ce7c54b2de985e319a17 /docs/manual/mod/mod_lua.xml
parentdocco xforms (diff)
downloadapache2-69c1a5c854b89a80cf5ca08b7b38d9f0a88c2667.tar.xz
apache2-69c1a5c854b89a80cf5ca08b7b38d9f0a88c2667.zip
Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/mod_lua.xml')
-rw-r--r--docs/manual/mod/mod_lua.xml60
1 files changed, 30 insertions, 30 deletions
diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml
index d8682111bf..ef02cc2069 100644
--- a/docs/manual/mod/mod_lua.xml
+++ b/docs/manual/mod/mod_lua.xml
@@ -32,14 +32,14 @@ request processing</description>
<compatibility>2.3 and later</compatibility>
<summary>
-<p>This module allows the server to be extended with scripts written in the
+<p>This module allows the server to be extended with scripts written in the
Lua programming language. The extension points (hooks) available with
<module>mod_lua</module> include many of the hooks available to
natively compiled Apache HTTP Server modules, such as mapping requests to
-files, generating dynamic responses, access control, authentication, and
+files, generating dynamic responses, access control, authentication, and
authorization</p>
-<p>More information on the Lua programming language can be found at the
+<p>More information on the Lua programming language can be found at the
<a href="http://www.lua.org/">the Lua website</a>.</p>
<note><code>mod_lua</code> is still in experimental state.
@@ -77,8 +77,8 @@ ending in <code>.lua</code> by invoking that file's
<section id="writinghandlers"><title>Writing Handlers</title>
<p> In the Apache HTTP Server API, the handler is a specific kind of hook
-responsible for generating the response. Examples of modules that include a
-handler are <module>mod_proxy</module>, <module>mod_cgi</module>,
+responsible for generating the response. Examples of modules that include a
+handler are <module>mod_proxy</module>, <module>mod_cgi</module>,
and <module>mod_status</module>.</p>
<p><code>mod_lua</code> always looks to invoke a Lua function for the handler, rather than
@@ -90,9 +90,9 @@ something like this:</p>
require "string"
---[[
- This is the default method name for Lua handlers, see the optional
- function-name in the LuaMapHandler directive to choose a different
+--[[
+ This is the default method name for Lua handlers, see the optional
+ function-name in the LuaMapHandler directive to choose a different
entry point.
--]]
function handle(r)
@@ -109,7 +109,7 @@ function handle(r)
end
else
r:puts("unknown HTTP method " .. r.method)
- end
+ end
end
</pre></example>
@@ -128,8 +128,8 @@ handlers (or hooks, or filters) in the same script.
<section id="writinghooks"><title>Writing Hooks</title>
<p>Hook functions are how modules (and Lua scripts) participate in the
-processing of requests. Each type of hook exposed by the server exists for
-a specific purposes such as mapping requests to the filesystem,
+processing of requests. Each type of hook exposed by the server exists for
+a specific purposes such as mapping requests to the filesystem,
performing access control, or setting mimetypes. General purpose hooks
that simply run at handy times in the request lifecycle exist as well.</p>
@@ -158,7 +158,7 @@ end
--[[ example hook that rewrites one URI to another URI. It returns a
apache2.DECLINED to give other URL mappers a chance to work on the
substitution, including the core translate_name hook which maps based
- on the DocumentRoot.
+ on the DocumentRoot.
Note: It is currently undefined as to whether this runs before or after
mod_alias.
@@ -183,7 +183,7 @@ end
<dd>
<p>The request_rec is mapped in as a userdata. It has a metatable
which lets you do useful things with it. For the most part it
- has the same fields as the request_rec struct (see httpd.h
+ has the same fields as the request_rec struct (see httpd.h
until we get better docs here) many of which are writeable as
well as readable. (The table fields' content can be changed, but the
fields themselves cannot be set to different tables.)</p>
@@ -314,7 +314,7 @@ end
<example>
r:addoutputfilter(name|function) -- add an output filter
</example>
-
+
<example>
r:parseargs() -- returns a lua table containing the request's
query string arguments
@@ -334,7 +334,7 @@ end
</example>
</dd>
</dl>
-
+
</section>
<section id="logging"><title>Logging Functions</title>
@@ -403,16 +403,16 @@ end
<usage>
<p>Specify the lifecycle scope of the Lua interpreter which will
be used by handlers in this "Directory." The default is "once"</p>
-
+
<dl>
<dt>once:</dt> <dd>use the interpreter once and throw it away.</dd>
-
- <dt>request:</dt> <dd>use the interpreter to handle anything based on
- the same file within this request, which is also
+
+ <dt>request:</dt> <dd>use the interpreter to handle anything based on
+ the same file within this request, which is also
request scoped.</dd>
-
+
<dt>conn:</dt> <dd>Same as request but attached to the connection_rec</dd>
-
+
<dt>server:</dt> <dd>This one is different than others because the
server scope is quite long lived, and multiple threads
will have the same server_rec. To accommodate this
@@ -445,7 +445,7 @@ end
to the file /scripts/photos.lua and invoke the
handler function handle_show on the lua vm after
loading that file.</p>
-
+
<example>
LuaMapHandler /bingo /scripts/wombat.lua
</example>
@@ -464,9 +464,9 @@ end
</contextlist>
<override>All</override>
<usage><p>Add a path to lua's module search path. Follows the same
- conventions as lua. This just munges the package.path in the
+ conventions as lua. This just munges the package.path in the
lua vms.</p>
-
+
<example><title>Examples:</title>
LuaPackagePath /scripts/lib/?.lua<br />
LuaPackagePath /scripts/lib/?/init.lua
@@ -485,9 +485,9 @@ end
<usage>
<p>Add a path to lua's shared library search path. Follows the same
- conventions as lua. This just munges the package.cpath in the
+ conventions as lua. This just munges the package.cpath in the
lua vms.</p>
-
+
</usage>
</directivesynopsis>
@@ -507,12 +507,12 @@ end
ones) each time that file is needed, and reloads it if the
modified time indicates it is newer than the one it has
already loaded. The other values cause it to keep the file
- cached forever (don't stat and replace) or to never cache the
+ cached forever (don't stat and replace) or to never cache the
file.</p>
-
+
<p>In general stat or forever is good for production, and stat or never
for development.</p>
-
+
<example><title>Examples:</title>
LuaCodeCache stat<br />
LuaCodeCache forever<br />
@@ -534,7 +534,7 @@ end
<usage><p>
Add a hook (at APR_HOOK_MIDDLE) to the translate name phase of
request processing. The hook function receives a single
- argument, the request_rec, and should return a status code,
+ argument, the request_rec, and should return a status code,
which is either an HTTP error code, or the constants defined
in the apache2 module: apache2.OK, apache2.DECLINED, or
apache2.DONE. </p>