You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2003/01/31 05:37:07 UTC

cvs commit: modperl-2.0/t/response/TestAPI r_subclass.pm

stas        2003/01/30 20:37:07

  Modified:    lib/Apache compat.pm
               t/response/TestAPI r_subclass.pm
  Log:
  adjustments to the new behavior of Apache->request, which asserts when is
  not configured to return the global object
  
  Revision  Changes    Path
  1.76      +4 -2      modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- compat.pm	15 Dec 2002 08:30:40 -0000	1.75
  +++ compat.pm	31 Jan 2003 04:37:06 -0000	1.76
  @@ -118,8 +118,10 @@
   
   sub httpd_conf {
       shift;
  -    my $err = (Apache->request || Apache->server)->
  -      add_config([split /\n/, join '', @_]);
  +    my $obj;
  +    eval { $obj = Apache->request };
  +    $obj = Apache->server if $@;
  +    my $err = $obj->add_config([split /\n/, join '', @_]);
       die $err if $err;
   }
   
  
  
  
  1.4       +2 -1      modperl-2.0/t/response/TestAPI/r_subclass.pm
  
  Index: r_subclass.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/r_subclass.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- r_subclass.pm	22 May 2002 18:53:33 -0000	1.3
  +++ r_subclass.pm	31 Jan 2003 04:37:07 -0000	1.4
  @@ -23,7 +23,8 @@
   
       plan $r, tests => 5;
   
  -    ok ! Apache->request;
  +    eval { Apache->request; };
  +    ok $@;
   
       ok $r->uri eq $location;