perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: Compat implementations of method_register and server_root_relative in tests ?
Date Mon, 09 Aug 2004 21:10:46 GMT


Stas Bekman wrote:
>>>So back to the compat issue. At the moment lib/Apache/compat.pm 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.
>>
>>
>>So would this patch resolve this open issue ?
> 
> 
> it's a good starting point, but it's incomplete.
> 
> 
>>Index: lib/Apache/compat.pm
>>===================================================================
>>RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
>>retrieving revision 1.114
>>diff -u -I$Id -r1.114 compat.pm
>>--- lib/Apache/compat.pm	24 Jul 2004 07:27:03 -0000	1.114
>>+++ lib/Apache/compat.pm	9 Aug 2004 20:57:22 -0000
>>@@ -249,8 +249,13 @@
>> package Apache;
>> 
>> sub server_root_relative {
>>-    my $class = shift;
>>-    File::Spec->catfile(Apache::ServerUtil::server_root, @_);
>>+    my ($class, $path, @extra) = @_;
>>+    if (File::Spec->file_name_is_absolute($path)) {
> 
> 
> $path could be undef. Many times people call just 
> Apache->server_root_relative().

Correct, noted and corrected below

> 
>>+        return File::Spec->catfile($path, @extra); 
>>+    }
>>+    else {
>>+        File::Spec->catfile(Apache::ServerUtil::server_root, $path, @extra);
>>+    }
>> }
> 
> 
> and tests :)

Yes, I reqalized I forgot to add them to my post.

> Geoff, was it the only thing about server_root_relative specifics, or 
> was there something else?


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