Grant McLean wrote:
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

Hi All

I know I can use $r->dir_config() to access parameter values
set in the config file with PerlSetVar, but is it possible to
access the value of generic Apache configuration directives?
This is described in the [EagleBook] (worth your money, IMHO),
and this particular chapter is available on-line:

Thanks for your reply. I agree, it is a great book and I spent quite some time reading it before asking the question.
Unfortunately, either I have missed something in the book or
you've misunderstood my question.

What I want to do is determine the current setting of the
standard 'DirectoryIndex' parameter used by mod_dir. This is not a simple PerlSetVar and it is not a new directive
I'm creating for my Perl module - both these scenarios are
covered in book. What I want to know is, for the current
Directory/VirtualHost/Server, what would mod_dir do?
you have very few options here. one of which is to do

<Perl>
$Apache::Server::SaveConfig = 1;
$DirectoryIndex = 'index.html';
</Perl>

then you can access the variable in your script as $Apache::ReadConfig::DirectoryIndex

you can also use directive handlers to override the DirectoryIndex directive and stash it someplace you know about. an example of how that can be accomplished is here:

http://www.modperlcookbook.org/code/ch14/Cookbook-MIMEMapper-0.01.tar.gz

the last resort is to plug right into mod_dir's private data. you can find an example of that kind of thing here:

http://www.modperlcookbook.org/code/ch08/Cookbook-LanguagePriority-0.01.tar.gz

HTH

--Geoff



Reply via email to