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 do...@hyperreal.org on 1998/08/29 00:33:35 UTC

cvs commit: modperl/t/internal dirmagic.t auth.t

dougm       98/08/28 15:33:35

  Modified:    .        Changes MANIFEST
               src/modules/perl mod_perl.c
               t/conf   httpd.conf-dist httpd.conf.pl
               t/docs   startup.pl
               t/internal auth.t
  Added:       t/docs/dirmagic cal.txt
               t/internal dirmagic.t
  Log:
  add DIR_MAGIC_TYPE to perl_handlers[] table for directory indexing
  modules
  
  Revision  Changes    Path
  1.121     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /export/home/cvs/modperl/Changes,v
  retrieving revision 1.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- Changes	1998/08/28 20:37:44	1.120
  +++ Changes	1998/08/28 22:33:27	1.121
  @@ -8,6 +8,9 @@
   
   =item 1.15_01-dev
   
  +add DIR_MAGIC_TYPE to perl_handlers[] table for directory indexing
  +modules
  +
   Apache::Log optimizations:
     ${r,s}->log->$method() will now accept a CODE ref as it's first
     argument, which is only called when LogLevel >= $method
  
  
  
  1.34      +2 -0      modperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /export/home/cvs/modperl/MANIFEST,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- MANIFEST	1998/07/30 15:37:12	1.33
  +++ MANIFEST	1998/08/28 22:33:27	1.34
  @@ -119,6 +119,7 @@
   t/modules/symbol.t
   t/internal/api.t
   t/internal/auth.t
  +t/internal/dirmagic.t
   t/internal/error.t
   t/internal/headers.t
   t/internal/hooks.t
  @@ -166,6 +167,7 @@
   lib/Apache/Status.pm
   lib/Bundle/Apache.pm
   t/docs/auth/.htaccess
  +t/docs/dirmagic/cal.txt
   t/docs/null.txt
   t/docs/error.txt
   t/docs/env.iphtml
  
  
  
  1.41      +1 -1      modperl/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- mod_perl.c	1998/08/25 19:10:37	1.40
  +++ mod_perl.c	1998/08/28 22:33:28	1.41
  @@ -181,8 +181,8 @@
   };
   
   static handler_rec perl_handlers [] = {
  -    { PERL_APACHE_SSI_TYPE, perl_handler },
       { "perl-script", perl_handler },
  +    { DIR_MAGIC_TYPE, perl_handler },
       { NULL }
   };
   
  
  
  
  1.13      +4 -0      modperl/t/conf/httpd.conf-dist
  
  Index: httpd.conf-dist
  ===================================================================
  RCS file: /export/home/cvs/modperl/t/conf/httpd.conf-dist,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- httpd.conf-dist	1998/08/25 18:49:49	1.12
  +++ httpd.conf-dist	1998/08/28 22:33:29	1.13
  @@ -56,6 +56,10 @@
   
   Alias /cgi-bin/ ./t/net/perl/
   
  +<Location /dirmagic>
  +PerlHandler My::DirIndex
  +</Location>
  +
   <Location /perl>
   ErrorDocument 500 /perl/server_error.pl
   SetHandler perl-script
  
  
  
  1.16      +5 -0      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- httpd.conf.pl	1998/08/07 22:00:11	1.15
  +++ httpd.conf.pl	1998/08/28 22:33:30	1.16
  @@ -104,6 +104,7 @@
   ($srv = $net::httpserver) =~ s/\D+$//;
   $Port = (split ":", $srv, 2)[1];
   $Port ||= 8529;
  +print "Will bind to Port $Port\n";
   
   $DocumentRoot = "$dir/docs";
   $ServerName = "localhost";
  @@ -119,6 +120,10 @@
       PerlHandler => "Apache::Registry",
       Options     => "ExecCGI",
   );
  +
  +$Location{"/dirmagic"} = {
  +    PerlHandler => "My::DirIndex",
  +};
   
   $Location{"/dirty-perl"} = { 
       SetHandler => "perl-script",
  
  
  
  1.18      +20 -0     modperl/t/docs/startup.pl
  
  Index: startup.pl
  ===================================================================
  RCS file: /export/home/cvs/modperl/t/docs/startup.pl,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- startup.pl	1998/08/07 22:00:12	1.17
  +++ startup.pl	1998/08/28 22:33:33	1.18
  @@ -144,6 +144,26 @@
       return OK;                       
   }
   
  +use Apache::Constants qw(DECLINED DIR_MAGIC_TYPE);
  +
  +sub My::DirIndex::handler {
  +    my $r = shift;
  +    return DECLINED unless $r->content_type and 
  +	$r->content_type eq DIR_MAGIC_TYPE;
  +    require DirHandle;
  +    my $dh = DirHandle->new($r->filename) or die $!;
  +    my @entries = $dh->read;
  +    my $x = @entries;
  +    $r->send_http_header('text/plain');
  +    print "1..$x\n";
  +    my $i = 1;
  +    for my $e (@entries) {
  +	print "ok $i ($e)\n";
  +	++$i;
  +    }
  +    1;
  +}
  +
   sub My::ProxyTest::handler {
       my $r = shift;
       unless ($r->proxyreq and $r->uri =~ /proxytest/) {
  
  
  
  1.1                  modperl/t/docs/dirmagic/cal.txt
  
  Index: cal.txt
  ===================================================================
  
  
  
  				1998
  
  	 Jan			Feb		       Mar
   S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
               1  2  3    1  2  3  4  5  6  7    1  2  3  4  5  6  7
   4  5  6  7  8  9 10    8  9 10 11 12 13 14    8  9 10 11 12 13 14
  11 12 13 14 15 16 17   15 16 17 18 19 20 21   15 16 17 18 19 20 21
  18 19 20 21 22 23 24   22 23 24 25 26 27 28   22 23 24 25 26 27 28
  25 26 27 28 29 30 31                          29 30 31
  
  	 Apr			May		       Jun
   S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
            1  2  3  4                   1  2       1  2  3  4  5  6
   5  6  7  8  9 10 11    3  4  5  6  7  8  9    7  8  9 10 11 12 13
  12 13 14 15 16 17 18   10 11 12 13 14 15 16   14 15 16 17 18 19 20
  19 20 21 22 23 24 25   17 18 19 20 21 22 23   21 22 23 24 25 26 27
  26 27 28 29 30         24 25 26 27 28 29 30   28 29 30
                         31
  	 Jul			Aug		       Sep
   S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
            1  2  3  4                      1          1  2  3  4  5
   5  6  7  8  9 10 11    2  3  4  5  6  7  8    6  7  8  9 10 11 12
  12 13 14 15 16 17 18    9 10 11 12 13 14 15   13 14 15 16 17 18 19
  19 20 21 22 23 24 25   16 17 18 19 20 21 22   20 21 22 23 24 25 26
  26 27 28 29 30 31      23 24 25 26 27 28 29   27 28 29 30
                         30 31
  	 Oct			Nov		       Dec
   S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
               1  2  3    1  2  3  4  5  6  7          1  2  3  4  5
   4  5  6  7  8  9 10    8  9 10 11 12 13 14    6  7  8  9 10 11 12
  11 12 13 14 15 16 17   15 16 17 18 19 20 21   13 14 15 16 17 18 19
  18 19 20 21 22 23 24   22 23 24 25 26 27 28   20 21 22 23 24 25 26
  25 26 27 28 29 30 31   29 30                  27 28 29 30 31
  
  
  
  
  
  
  
  1.2       +1 -1      modperl/t/internal/auth.t
  
  Index: auth.t
  ===================================================================
  RCS file: /export/home/cvs/modperl/t/internal/auth.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- auth.t	1997/12/06 17:57:13	1.1
  +++ auth.t	1998/08/28 22:33:34	1.2
  @@ -15,7 +15,7 @@
   my $response = $ua->request($request, undef, undef);
   
   test ++$i, $response->is_success;
  -print $response->as_string;
  +#print $response->as_string;
   $ua->creds(qw(bad one));
   
   $response = $ua->request($request, undef, undef);
  
  
  
  1.1                  modperl/t/internal/dirmagic.t
  
  Index: dirmagic.t
  ===================================================================
  use Apache::test;
  
  print fetch "/dirmagic";