perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject cvs commit: modperl-2.0/t/response/TestModules reload.pm
Date Thu, 09 Sep 2004 18:29:09 GMT
gozer       2004/09/09 11:29:09

  Modified:    .        Changes
               lib/Apache Reload.pm
               t/modules reload.t
               t/response/TestModules reload.pm
  Log:
  Add Apache::Reload->unregister_module() to explicitely remove a
  module from Apache::Reload's monitoring list.
  
  Revision  Changes    Path
  1.478     +3 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.477
  retrieving revision 1.478
  diff -u -r1.477 -r1.478
  --- Changes	9 Sep 2004 16:58:08 -0000	1.477
  +++ Changes	9 Sep 2004 18:29:09 -0000	1.478
  @@ -12,6 +12,9 @@
   
   =item 1.99_17-dev
   
  +Add Apache::Reload->unregister_module() to explicitely remove a
  +module from Apache::Reload's monitoring list [Gozer]
  +
   introduce a custom modperl error message for failing filter handlers
   (previously 'unknown error' coming from rc=500 was logged) [Stas]
   
  
  
  
  1.15      +6 -0      modperl-2.0/lib/Apache/Reload.pm
  
  Index: Reload.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Reload.pm,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Reload.pm	11 Mar 2004 06:34:24 -0000	1.14
  +++ Reload.pm	9 Sep 2004 18:29:09 -0000	1.15
  @@ -66,6 +66,12 @@
       }
   }
   
  +sub unregister_module {
  +    my($class, $package) = @_;
  +    my $module = package_to_module($package);
  +    delete $INCS{$module};
  +}
  +
   # the first argument is:
   # $c if invoked as 'PerlPreConnectionHandler'
   # $r if invoked as 'PerlInitHandler'
  
  
  
  1.3       +13 -1     modperl-2.0/t/modules/reload.t
  
  Index: reload.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/modules/reload.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- reload.t	8 Sep 2004 23:46:13 -0000	1.2
  +++ reload.t	9 Sep 2004 18:29:09 -0000	1.3
  @@ -6,7 +6,7 @@
   use Apache::TestRequest;
   use File::Spec::Functions qw(catfile);
   
  -plan tests => 2;
  +plan tests => 3;
   
   my $module   = 'TestModules::reload';
   my $location = '/' . Apache::TestRequest::module2path($module);
  @@ -58,6 +58,18 @@
           $expected,
           $received,
           "Reload"
  +    );
  +}
  +
  +{
  +    my $expected = "unregistered OK";
  +    my $received = get_body($same_interp, \&GET, $location . '?last' );
  +    $skip++ unless defined $received;
  +    skip_not_same_interp(
  +        $skip,
  +        $expected,
  +        $received,
  +        "Unregister"
       );
   }
   
  
  
  
  1.3       +9 -1      modperl-2.0/t/response/TestModules/reload.pm
  
  Index: reload.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestModules/reload.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- reload.pm	8 Sep 2004 23:46:39 -0000	1.2
  +++ reload.pm	9 Sep 2004 18:29:09 -0000	1.3
  @@ -5,10 +5,18 @@
   
   use Apache::Const -compile => qw(OK);
   
  +my $package = 'Apache::Reload::Test';
  +
   sub handler {
       my $r = shift;
  +    
  +    if ($r->args eq 'last') {
  +        Apache::Reload->unregister_module($package);
  +        $r->print("unregistered OK");
  +        return Apache::OK;
  +    }
   
  -    eval "use Apache::Reload::Test";
  +    eval "use $package";
   
       Apache::Reload::Test::run($r);
   
  
  
  

Mime
View raw message