stas        2003/02/17 01:39:54

  Modified:    lib/Apache Reload.pm
               .        Changes
  Log:
  Apache::Reload now supports the PerlPreConnectionHandler invocation
  mode, so connection filter and protocol modules can be automatically
  reloaded on change.
  
  Revision  Changes    Path
  1.9       +13 -7     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Reload.pm 17 Feb 2003 05:16:06 -0000      1.8
  +++ Reload.pm 17 Feb 2003 09:39:54 -0000      1.9
  @@ -9,7 +9,9 @@
   
   use Apache::Const -compile => qw(OK);
   
  -require Apache::RequestUtil;
  +use Apache::Connection;
  +use Apache::ServerUtil;
  +use Apache::RequestUtil;
   
   use vars qw(%INCS %Stat $TouchTime %UndefFields);
   
  @@ -50,12 +52,16 @@
       }
   }
   
  +# the first argument is:
  +# $c if invoked as 'PerlPreConnectionHandler'
  +# $r if invoked as 'PerlInitHandler'
   sub handler {
  -    my $r = shift;
  +    my $o = shift;
  +    $o = $o->base_server if ref($o) eq 'Apache::Connection';
   
  -    my $DEBUG = ref($r) && (lc($r->dir_config("ReloadDebug") || '') eq 'on');
  +    my $DEBUG = ref($o) && (lc($o->dir_config("ReloadDebug") || '') eq 'on');
   
  -    my $TouchFile = ref($r) && $r->dir_config("ReloadTouchFile");
  +    my $TouchFile = ref($o) && $o->dir_config("ReloadTouchFile");
   
       my $TouchModules;
   
  @@ -69,14 +75,14 @@
           chomp $TouchModules;
       }
   
  -    if (ref($r) && (lc($r->dir_config("ReloadAll") || 'on') eq 'on')) {
  +    if (ref($o) && (lc($o->dir_config("ReloadAll") || 'on') eq 'on')) {
           *Apache::Reload::INCS = \%INC;
       }
       else {
           *Apache::Reload::INCS = \%INCS;
           my $ExtraList = 
                   $TouchModules || 
  -                (ref($r) && $r->dir_config("ReloadModules")) || 
  +                (ref($o) && $o->dir_config("ReloadModules")) || 
                   '';
           my @extra = split(/\s+/, $ExtraList);
           foreach (@extra) {
  @@ -104,7 +110,7 @@
           }
       }
   
  -    my $ReloadDirs = ref($r) && $r->dir_config("ReloadDirectories");
  +    my $ReloadDirs = ref($o) && $o->dir_config("ReloadDirectories");
       my @watch_dirs = split(/\s+/, $ReloadDirs||'');
       while (my($key, $file) = each %Apache::Reload::INCS) {
           next if @watch_dirs && !grep { $file =~ /^$_/ } @watch_dirs;
  
  
  
  1.126     +4 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- Changes   17 Feb 2003 09:03:16 -0000      1.125
  +++ Changes   17 Feb 2003 09:39:54 -0000      1.126
  @@ -10,6 +10,10 @@
   
   =item 1.99_09-dev
   
  +Apache::Reload now supports the PerlPreConnectionHandler invocation
  +mode, so connection filter and protocol modules can be automatically
  +reloaded on change. [Stas]
  +
   implement Apache::current_callback + $r->current_callback goes into
   Apache::compat, since now we have a way too many callbacks unrelated
   to $r [Stas]
  
  
  


Reply via email to