You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2000/06/27 23:32:55 UTC

Re: Apache::Config module

Nathan Wiger <na...@wiger.org> wrote:
>Hi all-
>
>I've written a module that can parse the Apache httpd.conf config file
>(and in fact any Apache-like config file). It will take a set of
>directive like:

[snip]

>I am also finishing up the ability to parse within contexts, such as
><Directory> and <Location>. I am still unsure of the interface, I have
>two ideas:
> 
>    1. multi-level hash, i.e.
>          $conf->{"directory /"}->{sethandler}
> 
>    2. individual functions, i.e.
>          $conf->directory("/")->{sethandler}

Perhaps 

     3. multi-level hash, i.e.
           $conf->{directory}->{'/'}->{sethandler}

This is, afaik, more in-line with what the <Perl>...</Perl> sections do.  I 
would suggest making it so the output of this module could easily be fed into 
the mod_perl configuration engine in the <Perl> sections.  This gives us the 
ease of the second example with the programming simplicity of the first (i.e., 
no new functions).

We can also pull out the information we might want:  I can get a list of all 
the directories I'm configuring with the first or third method, but the first 
is messy.  The second method doesn't give us an obvious solution to this.

Even though I would not suggest configuring Apache by reading in a 
configuration file and feeding it to the mod_perl engine, it does have a 
certain aesthetic appeal to me... besides, I only have to learn one way of 
thinking about it :)
-- 
James Smith <JG...@TAMU.Edu>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix