You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Scott Hess <sc...@avantgo.com> on 1999/09/29 20:59:59 UTC
Nestable config directives.
For a module I'm working on, it would be convenient if I could group config
directives in groups that are in no way related to the request. Say that
there are multiple datastores, I'd like to be able to do something like:
<Datastore coredata>
# A bunch of config directives for my module
</Datastore>
<Datastore transientdata>
# A bunch of config directives, which may or may not be the same as
above
</Datastore>
Datastores coredata transientdata
The above is just a taste of what I want - but the core notion is that I'd
like to be able to group a bunch of directives in such a way that they can
travel as a group, rather than just being a bunch of directives which
coincidentally relate to each other. Also, each group should be distinct
(just as a Directory or Location directive), so that if I use the same
config directive in one config group as another, they don't conflict.
All I can think of right now would be to have a sentinel directive. When
that directive is hit, bundle up all of the prior results and start a new
result set. But that's overly reliant on how Apache orders config
processing.
Ideas? [If this should be obvious, _please_ point me at an example. I've
scoured the code and the website.]
Thanks,
scott
Re: Nestable config directives.
Posted by Ben Hyde <bh...@pobox.com>.
Immediate gratification: preprocess that config file prior to server starts
using m4 or perl. Curiously once I started doing that I found more and more
uses for this gimick - "I think I'm happy."
Adding new "containers" like <LocationMatch> or your <DataStore..> may
not be possible without laying into http_core.c where all the standard
ones are currently defined. I don't know, I've never tried it.
I did once try to do a module specific include file gimick and found
that not quite enough of the config file reader/parser mechinism exported
to let me leverage it, so I wrote my own.
- ben
"Scott Hess" <sc...@avantgo.com> writes:
> For a module I'm working on, it would be convenient if I could group config
...
> <Datastore coredata>
> # A bunch of config directives for my module
> </Datastore>
>
> <Datastore transientdata>
> # A bunch of config directives, which may or may not be the same as
> above
> </Datastore>
>
> Datastores coredata transientdata
>
>
> The above is just a taste of what I want - but the core notion is that I'd
> ...
Re: Nestable config directives.
Posted by Manoj Kasichainula <ma...@io.com>.
On Wed, Sep 29, 1999 at 11:59:59AM -0700, Scott Hess wrote:
> I'd like to be able to do something like:
>
> <Datastore coredata>
> # A bunch of config directives for my module
> </Datastore>
I don't think there's a way to do this in the current config
structure with just a module. (Could be wrong though)
You could structure your directives like this, though:
DirectiveName1 DataStoreName arg1 arg2
DirectiveName2 DataStoreName arg1 arg2 arg3
--
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/