Skip Menu |

This queue is for tickets about the Kwiki-ModPerl CPAN distribution.

Report information
The Basics
Id: 7412
Status: resolved
Priority: 0/
Queue: Kwiki-ModPerl

People
Owner: ian [...] cpan.org
Requestors: SMPETERS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Kwiki::ModPerl::handler method doesn't work in mod_perl 2
The handler method works fine for mod_perl 1, but is broken for mod_perl 2. In mod_perl 2, the method should omit the parameters "($$)" from the declaration. HTML::Mason::ApacheHandler currently deals with this issue by using a here doc in a begin to create the method. Hopefully, I'll have a patch forthcoming soon.
Date: Thu, 19 Aug 2004 18:15:14 -0400
From: Ian Langworth <bass [...] ccs.neu.edu>
To: via RT <bug-Kwiki-ModPerl [...] rt.cpan.org>
Subject: Re: [cpan #7412] Kwiki::ModPerl::handler method doesn't work in mod_perl 2
RT-Send-Cc:
On 19.Aug.2004 01:14PM -0400, via RT wrote: Show quoted text
> The handler method works fine for mod_perl 1, but is broken > for mod_perl 2. In mod_perl 2, the method should omit the > parameters "($$)" from the declaration. > HTML::Mason::ApacheHandler currently deals with this issue by > using a here doc in a begin to create the method. Hopefully, > I'll have a patch forthcoming soon.
As I mentioned in my other mail, I'm not too familiar with Apache 2. Isn't there some standard way of calling the handler as a method, not a package subroutine, that parallels the ($$) prototype for mod_perl+Apache-1 ? -- Ian Langworth Project Guerrilla Northeastern University College of Computer and Information Science
Show quoted text
> As I mentioned in my other mail, I'm not too familiar with > Apache 2. Isn't there some standard way of calling the handler > as a method, not a package subroutine, that parallels the ($$) > prototype for mod_perl+Apache-1 ?
Ping! Any luck with this? -- Ian Langworth Project Guerrilla Northeastern University College of Computer and Information Science
From: Steve Peters
[IAN - Tue Aug 24 22:53:51 2004]: Show quoted text
> > As I mentioned in my other mail, I'm not too familiar with > > Apache 2. Isn't there some standard way of calling the handler > > as a method, not a package subroutine, that parallels the ($$) > > prototype for mod_perl+Apache-1 ?
> > Ping! Any luck with this?
Attached is a patch for 0.04_1 to allow this lib to work with mod_perl 1 and 2 out of the box. Basically, the handler subroutine is placed in a BEGIN, turned into a string, and eval'ed. You probably want to add some error handling for the eval, but I'll let you decide the best way that you want to handle it.
--- lib/Kwiki/ModPerl.pm 2004-08-20 09:49:13.000000000 -0500 +++ /usr/lib/perl5/site_perl/5.8.4/Kwiki/ModPerl.pm 2004-10-11 10:22:37.000000000 -0500 @@ -22,7 +22,10 @@ return $hub; } -sub handler ($$) { +BEGIN { + + my $handler_code = sprintf <<'EOF', $mod_perl::VERSION >= 1.99 ? ': method' : '($$)'; +sub handler %s { my ($self, $r) = @_; # only handle the directory specified in the apache config. @@ -67,6 +70,9 @@ return OK; } +EOF + eval $handler_code; +} 1;
From: jpritikin [...] pobox.com
The patch from SMPETERS didn't work for me with mod_perl-1.99_17. It seems like there is a lot less autoloading in newer mod_perls? Anyway, you can take a look at what I came up with. My patch works _only_ with modperl2. I didn't bother with compatibility.
Download mp2
application/octet-stream 1.3k

Message body not shown because it is not plain text.

From: jpritikin [...] pobox.com
Oops, more testing reveals that send_http_header is deprecated. Here's a new patch.
Download mp2
application/octet-stream 1.3k

Message body not shown because it is not plain text.

Date: Tue, 7 Dec 2004 10:45:22 -0500
From: Ian Langworth <bass [...] ccs.neu.edu>
To: Joshua_Pritikin via RT <bug-Kwiki-ModPerl [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #7412] Kwiki::ModPerl::handler method doesn't work in mod_perl 2
RT-Send-Cc:
On 05.Dec.2004 07:16PM -0500, Joshua_Pritikin via RT wrote: Show quoted text
> Oops, more testing reveals that send_http_header is > deprecated. Here's a new patch.
Cool, thanks. I have a chance to apply them and release in a few weeks. -- Ian Langworth Project Guerrilla Northeastern University College of Computer and Information Science