use v5.6.0;
use PLP;
-die 'Wrong module version' if $PLP::VERSION ne '3.00';
+die 'Wrong module version' if $PLP::VERSION ne '3.01';
use vars qw($DEBUG);
my $path_info;
while (not -f $file) {
if (not $file =~ s/(\/+[^\/]*)$//) {
- $ENV{REDIRECT_STATUS} = '404';
- print STDERR "PLP: Not found: $file\n";
+ print STDERR "PLP: Not found: $ENV{PATH_TRANSLATED} ($ENV{REQUEST_URI})\n";
if ($mod_perl) {
Apache->request->uri($ENV{REQUEST_URI});
print STDOUT "Status: 404 Not Found";
Apache::exit();
} else {
- print STDOUT "Status: 404 Not Found\n\nNot found: $ENV{REQUEST_URI}";
+ PLP::error(undef, 404);
exit;
}
}
}
if (not -r $file) {
+ print STDERR "PLP: Can't read: $ENV{PATH_TRANSLATED} ($ENV{REQUEST_URI})\n";
if (exists $ENV{MOD_PERL}) {
print STDOUT "Status: 403 Forbidden";
Apache::exit();
} else {
- print STDOUT "Status: 403 Forbidden\n\nForbidden: $ENV{REQUEST_URI}";
+ PLP::error(undef, 403);
exit;
}
}
PLP::Functions->import();
eval qq{package PLP::Script; $PLP::code};
}
+ PLP::error($@, 1) if $@;
select STDOUT;
undef *{"PLP::Script::$_"} for keys %PLP::Script::;
PLP::SendHeaders() unless $PLP::sentheaders;
- if ($@ && $DEBUG & 1){
- print $header{'Content-Type'} =~ m!^text/html!i
- ? ("<hr><b>Debug</b><br>", Entity($@))
- : ("[Debug]\n", $@);
- }
}