perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Compat implementations of method_register and server_root_relative in tests ?
Date Mon, 09 Aug 2004 20:11:31 GMT
Philippe M. Chiasson wrote:
> from todo/release :
> * the following methods/functions are using compat implementations in
>   tests and should use the real 2.0 API: method_register,
>   server_root_relative
> As far as I can see, this is not the case anymore, so should we remove that
> entry ? Or am I missing something ?

I'm not sure about method_register, since it didn't exist in 1.0. I 
think both has to do with the pool argument. Since method_register is 
now $s->method_register, there is no problem with it indeed.

As for server_root_relative, there is still an issue with it. Since we 
have the pool problem with this method, I've documented it as deprecated
and inefficient (since it copies the returned string, just in case). 
I've suggested to use:

   File::Spec->catfile(Apache::ServerUtil::server_root, @_);

as a better solution. One thing I've missed, and Geoff (as usual) has 
corrected me, is that it doesn't cover the case when the argument $_[0] 
is already a full path instead of relative. This is an undocumented 
feature as far as Apache docs go.

So back to the compat issue. At the moment lib/Apache/ has:

sub server_root_relative {
     my $class = shift;
     File::Spec->catfile(Apache::ServerUtil::server_root, @_);

which doesn't cover that special case. I suppose before doing catfile we 
need to check whether $_[0] is already absolute, in which case we should 
not concat server_root in.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message