Subject: | Incompatible with Apache/mod_perl 2.x |
Apache::DBILogger does not work under mod_perl 2 - The solution seems to
be quite trivial, I'm attaching a patch that -at least for a simple
test- allows me to use Apache::DBILogger from both versions, by just
trying to include the right module (Constants.pm vs. Const.pm) inside evals.
Subject: | Apache-DBILogger.diff |
--- DBILogger.pm.orig 2007-02-26 10:56:04.000000000 -0600
+++ DBILogger.pm 2007-02-26 10:57:45.000000000 -0600
@@ -2,10 +2,19 @@
require 5.004;
use strict;
-use Apache::Constants qw( :common );
use DBI;
use Date::Format;
+BEGIN {
+ eval "use Apache::Constants qw(:common)";
+ if ($@) {
+ eval "use Apache::Const qw(:common)";
+ if ($@) {
+ die "Not under Apache, not under Apache2?\n$@";
+ }
+ }
+}
+
$Apache::DBILogger::revision = sprintf("%d.%02d", q$Revision: 1.20 $ =~ /(\d+)\.(\d+)/o);
$Apache::DBILogger::VERSION = "0.93";