8 require Apache::Constants;
10 # mod_perl initializer: returns 0 on success, Apache error code on failure
14 $PLP::print = 'PLP::Apache::print';
16 $ENV{PLP_FILENAME} = my $filename = $r->filename;
18 unless (-f $filename) {
19 return Apache::Constants::NOT_FOUND();
22 return Apache::Constants::FORBIDDEN();
25 $ENV{PLP_NAME} = $r->uri;
27 our $use_cache = $r->dir_config('PLPcache') !~ /^off$/i;
28 #S our $use_safe = $r->dir_config('PLPsafe') =~ /^on$/i;
29 my $path = $r->filename();
30 my ($file, $dir) = File::Basename::fileparse($path);
33 $PLP::code = PLP::source($file, 0, undef, $path);
38 # FAST printing under mod_perl
40 return unless grep length, @_;
41 PLP::sendheaders() unless $PLP::sentheaders;
42 $PLP::Apache::r->print(@_);
45 # This is the mod_perl handler.
48 if (my $ret = init($_[0])) {
54 return Apache::Constants::OK();