File: RegistryBB.pm

package info (click to toggle)
apache-perl 1.3.9-14.1-1.21.20000309-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,524 kB
  • ctags: 1,743
  • sloc: ansic: 9,017; perl: 7,822; sh: 864; makefile: 695
file content (43 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package Apache::RegistryBB;

use strict;
use vars qw(@ISA);
use Apache::Constants qw(NOT_FOUND 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;
    unless (-r $r->finfo) {
	$r->log_reason("file does not exist");
	return NOT_FOUND;
    }
    if (-d _) {
	$r->log_reason("attempt to invoke directory as script");
	return DECLINED;
    }
    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__