Stas Bekman wrote:
dorian wrote:
is there currently a prescribed method for accessing the "current" configuration for a request, i.e., after all the merges have been done, at the particular stage a request is in? that is, if i want to access the current valid DirectoryIndex when a PerlTypeHandler is called, after possible VirtualHost, Location, Directory and .htaccess have been merged? i tried Apache::Directive, but that seems to more or less just give me the conf as it was written.
If I remember correctly it was Doug and Philippe who wrote Apache::Directive. I didn't have a chance to play with it yet. I understand that what you are after is some merge method which will show you the values after the merge. Philippe, can we do that?
We can't really do that. The configuration tree is accessible thru Apache::Directive in it's expanded state. But as far as 'merging' them together to get effective configuration for, say '/foobar' is not really possible, IMO.
Remember that each C apache module keeps it's own configuration data structure and is free to merge it as it sees fit. So, from the perl land, even if we could trigger configuration merging for a given url, there would be no way to make sense of the data in each module's configuration data (effectively just a bunch of void *)
I know you can do:
$r->location_merge('container_string');
which forces an earlier merge, but I'm not sure it'll affect the conf tree shown by Apache::Directive.
Nah, it doesn't.
Have you tried looking at the C code to see whether there is a C API for that?
The only suggested way to achieve something like that is to piggyback configuration directive. If you have a module that wants to know the value of DirectoryIndex, for instance, you could implement a mod_perl handler that supports a DirectoryIndex directive, and return DECLINED, passing it back to mod_autoindex. That module would need to merge directory indexes in the same way mod_autoindex does it, but that's the core of the problem.
See Apache::Icon for a good example (it's not ported to 2.0 yet, but it's a good example of the technique)
-- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature