10 defined $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2
15 require Apache2::Const;
16 require Apache2::RequestRec;
17 require Apache2::RequestUtil;
18 require Apache2::RequestIO;
20 require Apache::Constants;
24 # mod_perl initializer: returns 0 on success, Apache error code on failure
28 $PLP::print = 'PLP::Apache::print';
30 $ENV{PLP_FILENAME} = my $filename = $r->filename;
32 unless (-f $filename) {
33 return MP2 ? Apache2::Const::HTTP_NOT_FOUND() : Apache::Constants::NOT_FOUND();
36 return MP2 ? Apache2::Const::HTTP_FORBIDDEN() : Apache::Constants::FORBIDDEN();
39 $ENV{PLP_NAME} = $r->uri;
41 our $use_cache = $r->dir_config('PLPcache') !~ /^off$/i;
42 #S our $use_safe = $r->dir_config('PLPsafe') =~ /^on$/i;
43 my $path = $r->filename();
44 my ($file, $dir) = File::Basename::fileparse($path);
47 $PLP::code = PLP::source($file, 0, undef, $path);
52 # FAST printing under mod_perl
54 return unless grep length, @_;
55 PLP::sendheaders() unless $PLP::sentheaders;
56 $PLP::Apache::r->print(@_);
59 # This is the mod_perl handler.
62 if (my $ret = init($_[0])) {
68 return MP2 ? Apache2::Const::OK() : Apache::Constants::OK();