perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@hyperreal.org
Subject cvs commit: modperl/t/conf httpd.conf.pl
Date Tue, 22 Sep 1998 15:33:42 GMT
dougm       98/09/22 08:33:42

  Modified:    .        Changes MANIFEST ToDo
               lib/Apache PerlRun.pm RegistryNG.pm
               src/modules/perl Log.xs
               t/conf   httpd.conf.pl
  Added:       lib/Apache RegistryBB.pm
  Log:
  Apache::PerlRun subclass-able-ness near complete, see new example
  modules Apache::RegistryNG and Apache::RegistryBB
  
  Revision  Changes    Path
  1.155     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /export/home/cvs/modperl/Changes,v
  retrieving revision 1.154
  retrieving revision 1.155
  diff -u -r1.154 -r1.155
  --- Changes	1998/09/22 15:01:14	1.154
  +++ Changes	1998/09/22 15:33:36	1.155
  @@ -8,6 +8,9 @@
   
   =item 1.15_02-dev
   
  +Apache::PerlRun subclass-able-ness near complete, see new example
  +modules Apache::RegistryNG and Apache::RegistryBB
  +
   fix compile problem under aix [Ed Hill <ed-hill@uiowa.edu>]
   
   fix 'make test' @INC problem under NT, thanks to Dale Couch
  
  
  
  1.40      +1 -0      modperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /export/home/cvs/modperl/MANIFEST,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- MANIFEST	1998/09/22 14:05:39	1.39
  +++ MANIFEST	1998/09/22 15:33:37	1.40
  @@ -50,6 +50,7 @@
   lib/Apache/PerlSections.pm
   lib/Apache/Registry.pm
   lib/Apache/RegistryNG.pm
  +lib/Apache/RegistryBB.pm
   lib/Apache/RegistryLoader.pm
   lib/Apache/Resource.pm
   #lib/Apache/Safe.pm
  
  
  
  1.91      +0 -2      modperl/ToDo
  
  Index: ToDo
  ===================================================================
  RCS file: /export/home/cvs/modperl/ToDo,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- ToDo	1998/09/19 17:38:14	1.90
  +++ ToDo	1998/09/22 15:33:37	1.91
  @@ -3,8 +3,6 @@
                    (well, close to it anyhow)
   ---------------------------------------------------------------------------
   
  -- cache method for Apache::PerlRun
  -
   - $ENV{PATH}
   
   - 'make htmldoc' (Brian Moseley)
  
  
  
  1.9       +9 -3      modperl/lib/Apache/PerlRun.pm
  
  Index: PerlRun.pm
  ===================================================================
  RCS file: /export/home/cvs/modperl/lib/Apache/PerlRun.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PerlRun.pm	1998/09/22 14:05:40	1.8
  +++ PerlRun.pm	1998/09/22 15:33:40	1.9
  @@ -87,11 +87,16 @@
       $pr->{'sub'} = \$sub;
   }
   
  +sub cached {
  +    my($pr) = @_;
  +    exists $Apache::Registry->{$pr->namespace}{'mtime'};
  +}
  +
   sub should_compile {
       my($pr, $package, $mtime) = @_;
       $package ||= $pr->{'namespace'};
       $mtime   ||= $pr->{'mtime'};
  -    !(exists $Apache::Registry->{$package}{'mtime'}
  +    !($pr->cached
       &&
         $Apache::Registry->{$package}{'mtime'} <= $mtime);
   }
  @@ -118,12 +123,12 @@
   }
   
   sub run {
  -    my($pr) = @_;
  +    my $pr = shift;
       my $package = $pr->{'namespace'};
   
       my $rc = OK;
       my $cv = \&{"$package\::handler"};
  -    eval { $rc = &{$cv}($pr->{'_r'}, @_) } if $pr->seqno;
  +    eval { $rc = &{$cv}($pr, @_) } if $pr->seqno;
       $pr->{status} = $rc;
   
       my $errsv = "";
  @@ -147,6 +152,7 @@
   
   sub namespace {
       my($pr, $root) = @_;
  +    return $pr->{'namespace'} if $pr->{'namespace'};
   
       my $uri = $pr->uri; 
       $uri = "/__INDEX__" if $uri eq "/";
  
  
  
  1.2       +11 -7     modperl/lib/Apache/RegistryNG.pm
  
  Index: RegistryNG.pm
  ===================================================================
  RCS file: /export/home/cvs/modperl/lib/Apache/RegistryNG.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryNG.pm	1998/09/22 14:04:02	1.1
  +++ RegistryNG.pm	1998/09/22 15:33:40	1.2
  @@ -7,14 +7,18 @@
   $VERSION = '1.00';
   @ISA = qw(Apache::PerlRun);
   
  +#OO replacement for Apache::Registry
  +#configure like so:
  +# <Location /perl>
  +# SetHandler perl-script
  +# PerlHandler Apache::RegistryNG->handler
  +# Options +ExecCGI
  +# </Location>
  +# see also: Apache::RegistryBB
  + 
   sub handler ($$) {
  -    my($class, $r);
  -    if(@_ == 1) {
  -	($class, $r) = (__PACKAGE__, @_);
  -    }
  -    else {
  -	($class, $r) = (shift,shift);
  -    }
  +    my($class, $r) = (shift,shift);
  +
       my $pr = $class->new($r);
   
       my $rc = $pr->can_compile;
  
  
  
  1.1                  modperl/lib/Apache/RegistryBB.pm
  
  Index: RegistryBB.pm
  ===================================================================
  package Apache::RegistryBB;
  
  use strict;
  use vars qw(@ISA);
  use Apache::Constants qw(FORBIDDEN OK);
  use Apache::RegistryNG (); 
  @ISA = qw(Apache::RegistryNG);
  
  #Apache::Registry - Bare-Bones
  #configure like so:
  # PerlModule Apache::RegistryBB
  # <Location /perl>
  # SetHandler perl-script
  # PerlHandler ApacheRegistryBB->handler
  # </Location>
  
  #skip -x, OPT_EXEC, etc. checks
  sub can_compile {
      my $r = shift;
      if(-d $r->finfo) {
  	$r->log_reason("attempt to invoke directory as script");
  	return FORBIDDEN;
      }
      return OK;
  }
  
  #only cache once, don't re-compile if updated on disk
  sub should_compile {
      not shift->cached;
  }
  
  #don't chdir() to the script file directory
  sub chdir_file {
     #noop
  }
  
  1;
  
  __END__
  
  
  
  1.5       +2 -2      modperl/src/modules/perl/Log.xs
  
  Index: Log.xs
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/Log.xs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Log.xs	1998/09/01 17:42:07	1.4
  +++ Log.xs	1998/09/22 15:33:41	1.5
  @@ -145,16 +145,16 @@
           croak("Argument is not a reference");
   
       if(sv_derived_from(sv, "Apache")) {
  -	/*ok*/
  +	retval = (void*)sv2request_rec(sv, "Apache", cv);
       }
       else if(sv_derived_from(sv, "Apache::Server")) {
   	class = "Apache::Log::Server";
  +	retval = (void *) SvIV((SV*)SvRV(sv));
       }
       else {
           croak("Argument is not an Apache or Apache::Server object");
       }
   
  -    retval = (void *) SvIV((SV*)SvRV(sv));
       ST(0) = sv_newmortal();
       sv_setref_pv(ST(0), class, (void*)retval);
   
  
  
  
  1.19      +1 -1      modperl/t/conf/httpd.conf.pl
  
  Index: httpd.conf.pl
  ===================================================================
  RCS file: /export/home/cvs/modperl/t/conf/httpd.conf.pl,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- httpd.conf.pl	1998/09/22 14:05:41	1.18
  +++ httpd.conf.pl	1998/09/22 15:33:42	1.19
  @@ -122,7 +122,7 @@
   
   my @mod_perl = (
       SetHandler  => "perl-script",
  -    PerlHandler => "Apache::RegistryNG",
  +    PerlHandler => "Apache::RegistryNG->handler",
       Options     => "ExecCGI",
   );
   
  
  
  

Mime
View raw message