cvsuser     04/02/02 14:17:18

  Modified:    App-Context/lib App.pm
  Log:
  fixed bug with trace_subs in service()
  
  Revision  Changes    Path
  1.9       +25 -22    p5ee/App-Context/lib/App.pm
  
  Index: App.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Context/lib/App.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- App.pm    2 Feb 2004 21:22:08 -0000       1.8
  +++ App.pm    2 Feb 2004 22:17:18 -0000       1.9
  @@ -1,6 +1,6 @@
   
   #############################################################################
  -## $Id: App.pm,v 1.8 2004/02/02 21:22:08 spadkins Exp $
  +## $Id: App.pm,v 1.9 2004/02/02 22:17:18 spadkins Exp $
   #############################################################################
   
   package App;
  @@ -570,7 +570,8 @@
           $name = $options->{name} if (!$name); # if not given, look in options
           $name = "default" if (!$name);                # use "default" as name
       }
  -    return ($context{$name}) if (defined $context{$name});   # return context
  +
  +    if (!defined $context{$name}) {
       
       if (! $options->{context_class}) {
           if (defined $ENV{APP_CONTEXT_CLASS}) {            # env variable set?
  @@ -597,6 +598,7 @@
   
       # instantiate Context and cache it (it's reference) for future use
       $context{$name} = $self->new($options->{context_class}, "new", $options);
  +    }
   
       &App::sub_exit($context{$name}) if ($App::trace_subs);
       return($context{$name});
  @@ -640,6 +642,7 @@
       my $self = shift;
       my $retval = $self->context(@_)->conf();
       &App::sub_exit($retval) if ($App::trace_subs);
  +    $retval;
   }
   
   #############################################################################
  
  
  

Reply via email to