httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Question about hooks in mod_include.
Date Tue, 28 Nov 2000 22:21:51 GMT

You have the idea correct mostly.  The hook is used to allow modules to
register their functions with the hash table.  The reason for the hook, is
that it makes things a bit clearer for the module writers.  Basically, if
mod_include just exports the function, then when do include_modules call
that function?  The explicit hook just makes it very obvious as to when
those functions should be registered.


On Tue, 28 Nov 2000, Paul J. Reder wrote:

> Ryan,
> You mentioned using hooks in mod_include (ala experimental/mod_cache) to allow
> modules to register handle_x functions with mod_include.
> I am confused by this for the following reason. As I understand it, this would
> create a hook list of module functions that mod_include would run (via
> ap_run_hook...) when it found an SSI. Each registered hook function would get
> a shot until one of them handled the SSI.
> This doesn't allow for the registration with mod_include of a hashable "directive
> token"/handler_x function pair for quick access and extendibility.
> Unless you are talking about something like allowing the modules to register a
> hook function early in the process which will perform the directive registration
> with mod_include when the hook is run by mod_include later in the init processing.
> This seems unnecessarily complex.
> It seems to me that what we need is an exported function in mod_include that
> gets called from other modules that would like to register a directive/function
> pair (i.e.. register_include_handler("perl", handle_perl); where handle_perl is
> a function in the perl code that can handle perl SSI directives). Mod_include would
> then insert the function into the hash table using the directive as the key.
> Where am I not understanding the hook code?
> -- 
> Paul J. Reder
> -----------------------------------------------------------
> "The strength of the Constitution lies entirely in the determination of each
> citizen to defend it.  Only if every single citizen feels duty bound to do
> his share in this defense are the constitutional rights secure."
> -- Albert Einstein

Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message