1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00

Add some more information about which request phases are available for hooking, and what they do.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1368416 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Gruno
2012-08-02 11:09:58 +00:00
parent abafe1bd90
commit 1866c2757c

View File

@@ -194,8 +194,70 @@ LuaAuthzProvider foo authz_provider.lua authz_check_foo
<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,
performing access control, or setting mimetypes. General purpose hooks
that simply run at handy times in the request lifecycle exist as well.</p>
performing access control, or setting mimetypes:</p>
<table border="1" style="zebra">
<tr>
<th>Hook phase</th>
<th>mod_lua directive</th>
<th>Description</th>
</tr>
<tr>
<td>Quick handler</td>
<td><directive module="mod_lua">LuaQuickHandler</directive></td>
<td>This is the first hook that will be called after a request has
been mapped to a host or virtual host</td>
</tr>
<tr>
<td>Translate name</td>
<td><directive module="mod_lua">LuaHookTranslateName</directive></td>
<td>This phase translates the requested URI into a filename on the
system. Modules such as <module>mod_alias</module> and
<module>mod_rewrite</module> operate in this phase.</td>
</tr>
<tr>
<td>Map to storage</td>
<td><directive module="mod_lua">LuaHookMapToStorage</directive></td>
<td>This phase maps files to their physical, cached or external/proxied storage.
It can be used by proxy or caching modules</td>
</tr>
<tr>
<td>Check Access</td>
<td><directive module="mod_lua">LuaHookAuthChecker</directive> or <directive module="mod_lua">LuaAuthzProvider</directive></td>
<td>This phase authenticates and grants or denies access to the
requested resource</td>
</tr>
<tr>
<td>Check User ID</td>
<td><directive module="mod_lua">LuaHookCheckUserID</directive></td>
<td>This phase it used to check the negotiated user ID</td>
</tr>
<tr>
<td>Check Type</td>
<td><directive module="mod_lua">LuaHookTypeChecker</directive></td>
<td>This phase checks the requested file and assigns a content type and
a handler to it</td>
</tr>
<tr>
<td>Fixups</td>
<td><directive module="mod_lua">LuaHookFixups</directive></td>
<td>This is the final "fix anything" phase before the content handlers
are run. Any last-minute changes to the request should be made here.</td>
</tr>
<tr>
<td>Content handler</td>
<td>fx. <code>.lua</code> files or through <directive module="mod_lua">LuaMapHandler</directive></td>
<td>This is where the content is handled. Files are read, parsed, some are run,
and the result is sent to the client</td>
</tr>
<tr>
<td>Logging</td>
<td>(none)</td>
<td>Once a request has been handled, it enters several logging phases,
which logs the request in either the error or access log</td>
</tr>
</table>
<p>Hook functions are passed the request object as their only argument.
They can return any value, depending on the hook, but most commonly