perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: what is the best way to do ...
Date Thu, 23 Feb 2006 22:41:43 GMT
Torsten Foertsch wrote:
> On Tuesday 21 February 2006 19:17, Geoffrey Young wrote:
> 
>>>I need something like this:
>>>
>>>__END__
>>><IfVersion >= 2.2.0>
>>>AllowOverride AuthConfig Options=Indexes,FollowSymLinks
>>></IfVersion>
>>>
>>>Unfortunately, IfVersion is valid only from 2.0.56 on. Is there a
>>>workaround in mod_perl or AT?
>>
>>I understand what you're asking, but it's not there :)
>>
>>I take it that Options=Indexes is the problematic part?
>>
>>the only thing I can think of is using something like this
>>
>>  <IfDefine APACHE2_2>
>>   ...
>>  </IfDefine>
>>
>>then using t/TEST.PL as a template (instead of the default generated
>>t/TEST) and include logic something like this
>>
>>if (have_min_apache_version(2.2)) {
>>  Apache::TestRunPerl->new->run(@ARGV, '-defines', 'APACHE2_2');
>>}
>>else {
>>  Apache::TestRunPerl->new->run(@ARGV);
>>}
>>
>>or somesuch.  you'll need to pull some additional trickery to actually get
>>have_min_apache_version() to work but I think you get the idea :)
> 
> 
> Thanks Geoff.
> 
> I am actually preparing a patch for mod_perl that solves these problems:
> 
> http://www.gossamer-threads.com/lists/modperl/dev/86456
> http://www.gossamer-threads.com/lists/modperl/dev/86972
> 
> It 
> 
> a) extends the interface of Apache2::RequestUtil::add_config:
> 
>    $r->add_config(\@lines, $override, $path, $override_opts)
> 
> b) adds a function allow_override_opts() to read
>    ((core_dir_config *)conf)->override_opts
> 
> c) adds Apache2::CmdParms::override_opts.
> 
> For Apache 2.0.x these functions return 255, the default value in 2.2. Setting 
> Apache2::CmdParms::override_opts dies for 2.0 and the override_opts parameter 
> to add_config is simply ignored in 2.0.
> 
> When adding tests I stumbled. Where do I have to add the -defines trick in 
> this case?
> 
> Btw, does anyone know why $r->add_config always passes a path in cmd_parms?

It used to pass in NULL all the time, until someone pointed out that it was
causing a bug with certain directives. So the fix was adding the $path argument
to add_config().

> I  have tried passing also NULL pointers. For some configuration directives that 
> causes segfaults but sometimes it's useful (for example if a <Location> block 
> is to be passed to $r->add_config). I'd like to extend the interface to pass 
> a NULL pointer in cmd_parms if an empty string is passed to add_config.

That's not what's hapenning currently ?

> Would such a patch have any chances to get into mod_perl?

Yes, it sounds like a good idea overall. I would suggest you try and break up the problem
in many smaller patches instead of one big patch. It's easier to review, and it usually
simplifies the problem being solved at the same time.

As for the extra argument to add_config, I thought you mentionned a more elegant
solution that didn't add an extra argument, but introduced a new object wrapper
for override_opts that could be passed in. I am curious about what hapenned to
that idea, it sounded good to me.

--------------------------------------------------------------------------------
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

Mime
View raw message