Skip Menu |

This queue is for tickets about the Apache-Singleton CPAN distribution.

Report information
The Basics
Id: 71218
Status: resolved
Priority: 0/
Queue: Apache-Singleton

People
Owner: Nobody in particular
Requestors: shay [...] cpan.org
Cc:
AdminCc:

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



Subject: Apache::Singleton::Request is not loaded by default under mod_perl
If I derive a class from Apache::Singleton, leaving it to its own devices to decide whether to use Apache::Singleton::Request or Apache::Singleton::Process as appropriate, then under mod_perl-2 I get the error: Can't locate object method "_get_instance" via package "Apache::Singleton::Request" (perhaps you forgot to load "Apache::Singleton::Request"?) at C:/Perl/site/lib/Apache/Singleton.pm line 38. It seems that the Singleton module loads Process when not under mod_perl, but fails to load Request when under mod_perl. The attached patch fixes this. It would also be worth noting that the global request object is required for mod_perl-2 operation, i.e. set PerlOptions +GlobalRequest in the httpd.conf or call Apache2::RequestUtil->request($r) in the handler, otherwise the Apache2::RequestUtil->request() call in Request.pm fails with the error "Global $r object is not available".
Subject: request.patch
diff -ruN Apache-Singleton-0.13.orig/lib/Apache/Singleton.pm Apache-Singleton-0.13/lib/Apache/Singleton.pm --- Apache-Singleton-0.13.orig/lib/Apache/Singleton.pm 2011-05-29 20:32:02.000000000 +0100 +++ Apache-Singleton-0.13/lib/Apache/Singleton.pm 2011-09-25 17:21:02.125000000 +0100 @@ -7,7 +7,10 @@ use strict; -unless ($ENV{MOD_PERL}) { +if ($ENV{MOD_PERL}) { + require Apache::Singleton::Request; +} +else { require Apache::Singleton::Process; }
Subject: Re: [rt.cpan.org #71218] Apache::Singleton::Request is not loaded by default under mod_perl
Date: Tue, 06 Dec 2011 11:23:17 -0600
To: bug-Apache-Singleton [...] rt.cpan.org
From: Michael Schout <mschout [...] gkg.net>
Sorry it took me so long to get to this. I just released the fixed version 0.14. Regards, Michael Schout