From 1866c2757cb75ea1a1efd261b5d1d60f3bac38fd Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Thu, 2 Aug 2012 11:09:58 +0000 Subject: [PATCH] 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 --- docs/manual/mod/mod_lua.xml | 66 +++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml index 4893519286..be66a51504 100644 --- a/docs/manual/mod/mod_lua.xml +++ b/docs/manual/mod/mod_lua.xml @@ -194,8 +194,70 @@ LuaAuthzProvider foo authz_provider.lua authz_check_foo

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.

+performing access control, or setting mimetypes:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hook phasemod_lua directiveDescription
Quick handlerLuaQuickHandlerThis is the first hook that will be called after a request has + been mapped to a host or virtual host
Translate nameLuaHookTranslateNameThis phase translates the requested URI into a filename on the + system. Modules such as mod_alias and + mod_rewrite operate in this phase.
Map to storageLuaHookMapToStorageThis phase maps files to their physical, cached or external/proxied storage. + It can be used by proxy or caching modules
Check AccessLuaHookAuthChecker or LuaAuthzProviderThis phase authenticates and grants or denies access to the + requested resource
Check User IDLuaHookCheckUserIDThis phase it used to check the negotiated user ID
Check TypeLuaHookTypeCheckerThis phase checks the requested file and assigns a content type and + a handler to it
FixupsLuaHookFixupsThis is the final "fix anything" phase before the content handlers + are run. Any last-minute changes to the request should be made here.
Content handlerfx. .lua files or through LuaMapHandlerThis is where the content is handled. Files are read, parsed, some are run, + and the result is sent to the client
Logging(none)Once a request has been handled, it enters several logging phases, + which logs the request in either the error or access log

Hook functions are passed the request object as their only argument. They can return any value, depending on the hook, but most commonly -- 2.40.0