perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <>
Subject Re: what is the best way to do ...
Date Tue, 21 Feb 2006 19:39:35 GMT
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:


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

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


View raw message