- Reviving with mod_perl2 new API

- Drop maintainership

PR:		ports/82457
Submitted by:	maintainer
This commit is contained in:
Sergey Matveychuk 2005-06-23 09:01:47 +00:00
parent a75d049e14
commit c5a87a6611
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=137908
2 changed files with 14 additions and 13 deletions

View file

@ -7,11 +7,12 @@
PORTNAME= PLP PORTNAME= PLP
PORTVERSION= 3.18 PORTVERSION= 3.18
PORTREVISION= 1
CATEGORIES= www perl5 CATEGORIES= www perl5
MASTER_SITES= http://plp.juerd.nl/files/ MASTER_SITES= http://plp.juerd.nl/files/
PKGNAMEPREFIX= p5- PKGNAMEPREFIX= p5-
MAINTAINER= apeiron@comcast.net MAINTAINER= ports@FreeBSD.org
COMMENT= A simple Perl embedder superficially resembling PHP COMMENT= A simple Perl embedder superficially resembling PHP
PERL_CONFIGURE= yes PERL_CONFIGURE= yes
@ -23,8 +24,7 @@ MAN3= PLP.3 PLP::FAQ.3 PLP::Fields.3 PLP::Functions.3 PLP::HowTo.3 \
.if ${WITH_MOD_PERL} == 1 .if ${WITH_MOD_PERL} == 1
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/mod_perl.pm:${PORTSDIR}/www/mod_perl
.elif ${WITH_MOD_PERL} == 2 .elif ${WITH_MOD_PERL} == 2
BROKEN= Broken due the new mod_perl2 API RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/mod_perl2.pm:${PORTSDIR}/www/mod_perl2
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Apache2/mod_perl.pm:${PORTSDIR}/www/mod_perl2
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-mod_perl2.pm EXTRA_PATCHES= ${PATCHDIR}/extra-patch-mod_perl2.pm
.else .else
IGNORE= WITH_MOD_PERL must be either '1' or '2', or undefined IGNORE= WITH_MOD_PERL must be either '1' or '2', or undefined

View file

@ -1,12 +1,13 @@
--- PLP.pm.orig Fri Oct 18 15:47:07 2002 --- PLP.pm.orig Wed Jun 22 04:02:50 2005
+++ PLP.pm Tue Jun 1 15:49:07 2004 +++ PLP.pm Wed Jun 22 04:02:52 2005
@@ -131,7 +131,12 @@ @@ -131,7 +131,13 @@
# This is the mod_perl handler. # This is the mod_perl handler.
sub handler { sub handler {
- require Apache::Constants; - require Apache::Constants;
+ if($ENV{'mod_perl2_compat'} eq 'on') { + if($ENV{'mod_perl2_compat'} eq 'on') {
+ use Apache::Const -compile => qw(OK); + require Apache2::Const;
+ import Apache2::Const -compile => qw(OK);
+ } + }
+ else { + else {
+ require Apache::Constants; + require Apache::Constants;
@ -14,13 +15,13 @@
clean(); clean();
if (my $ret = mod_perl_init($_[0])) { if (my $ret = mod_perl_init($_[0])) {
return $ret; return $ret;
@@ -139,7 +144,12 @@ @@ -139,7 +145,12 @@
#S start($_[0]); #S start($_[0]);
start(); start();
no strict 'subs'; no strict 'subs';
- return Apache::Constants::OK(); - return Apache::Constants::OK();
+ if($ENV{'mod_perl2_compat'} eq 'on') { + if($ENV{'mod_perl2_compat'} eq 'on') {
+ return Apache::Const::OK; + return Apache2::Const::OK;
+ } + }
+ else { + else {
+ return Apache::Constants::OK(); + return Apache::Constants::OK();
@ -28,13 +29,13 @@
} }
# mod_perl initializer: returns 0 on success, Apache error code on failure # mod_perl initializer: returns 0 on success, Apache error code on failure
@@ -151,10 +161,20 @@ @@ -151,10 +162,20 @@
$ENV{PLP_FILENAME} = my $filename = $r->filename; $ENV{PLP_FILENAME} = my $filename = $r->filename;
unless (-f $filename) { unless (-f $filename) {
- return Apache::Constants::NOT_FOUND(); - return Apache::Constants::NOT_FOUND();
+ if($ENV{'mod_perl2_compat'} eq 'on') { + if($ENV{'mod_perl2_compat'} eq 'on') {
+ return Apache::Const::NOT_FOUND(); + return Apache2::Const::NOT_FOUND;
+ } + }
+ else { + else {
+ return Apache::Constants::NOT_FOUND(); + return Apache::Constants::NOT_FOUND();
@ -43,7 +44,7 @@
unless (-r _) { unless (-r _) {
- return Apache::Constants::FORBIDDEN(); - return Apache::Constants::FORBIDDEN();
+ if($ENV{'mod_perl2_compat'} eq 'on') { + if($ENV{'mod_perl2_compat'} eq 'on') {
+ return Apache::Const::FORBIDDEN(); + return Apache2::Const::FORBIDDEN;
+ } + }
+ else { + else {
+ return Apache::Constants::FORBIDDEN(); + return Apache::Constants::FORBIDDEN();