perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: [mp2] is DIR_CREATE called for <Proxy spec> directives ?
Date Tue, 30 May 2006 12:32:59 GMT
Charles Bueche wrote:
> Hi again,
> 
> responding to my own request : no. If one wants the default behavior
> 
> "child container inherits its parent configuration, unless it specifies
> its own and then overrides its parent configuration"
> 
> no need to use DIR_MERGE.

yeah, but for clarity this is what that means (pulling from my cobweb
covered memory :)

<parent>
  Directive1 foo
  Directive2 bar
</parent>

<child1>
  # child1 _does not_ inherit _any_ Directive1 configuration!
  Directive2 baz
</child1>

<child2>
  #child2 inherits _all_ from the parent
</child2>

in other words, unless you DIR_MERGE you get _exactly_ what you
configuration is specified in the child, unless there is none, in which
case you inherit.  what makes it tricky is the first example - if you
specify only part of a config you don't inherit the other directives.

again, at least insofar as I can recall.  of course, for clarity, just
define a DIR_MERGE subroutine, which is pretty simple

  sub DIR_MERGE {
    my ($base, $add) = @_;
    my %new = (%$add, %$base);
    return bless \%new, ref($base);
  }

HTH

--Geoff

Mime
View raw message