Re: [mp2] Apache::DBI and Apache::Status

[prev] [thread] [next] [Date index for 2004/11/05]

From: Stas Bekman
Subject: Re: [mp2] Apache::DBI and Apache::Status
Date: 21:22 on 05 Nov 2004
Scott Scecina wrote:
> I haven't been able to find an answer to this, so I thought I'd throw it
> out here:
> 
> Apache::DBI used to "plugin" to Apache::Status in order to display the DBI
> connections.  Is this not supported in mp2?

Looks like it wasn't ported to mp2. The following patch should do the trick.

I hope Ask integrates it.

--- /tmp/DBI.pm 2004-11-05 16:09:14.779192529 -0500
+++ /tmp/DBI.pm.new     2004-11-05 16:21:03.967049395 -0500
@@ -193,9 +193,18 @@


  # prepare menu item for Apache::Status
+use mod_perl;
+use constant MP2 => ($mod_perl::VERSION >= 1.99);
+my $apache_status_avail = 0;
+$apache_status_avail = 1
+    if !MP2 and $INC{'Apache.pm'}         # is Apache.pm loaded?
+    and Apache->can('module')             # really?
+    and Apache->module('Apache::Status'); # Apache::Status too?
+$apache_status_avail = 1
+    if MP2 and require Apache::Module
+    and Apache::Module::loaded('Apache::Status');

  Apache::Status->menu_item(
-
      'DBI' => 'DBI connections',
      sub {
          my($r, $q) = @_;
@@ -207,9 +216,7 @@
          return \@s;
     }

-) if ($INC{'Apache.pm'}                      # is Apache.pm loaded?
-      and Apache->can('module')               # really?
-      and Apache->module('Apache::Status'));  # Apache::Status too?
+) if $apache_status_avail;

  1;


        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Global Variables - What is in Memory?
Justin Luster 02:53 on 05 Nov 2004

Re: Global Variables - What is in Memory?
Malcolm J Harwood 15:09 on 05 Nov 2004

[mp2] Apache::DBI and Apache::Status
Scott Scecina 15:53 on 05 Nov 2004

Re: [mp2] Apache::DBI and Apache::Status
Stas Bekman 21:22 on 05 Nov 2004

RE: Global Variables - What is in Memory?
Justin Luster 16:50 on 05 Nov 2004

Re: Global Variables - What is in Memory?
Malcolm J Harwood 17:22 on 05 Nov 2004

RE: Global Variables - What is in Memory?
Justin Luster 17:37 on 05 Nov 2004

Re: Global Variables - What is in Memory?
Perrin Harkins 17:02 on 05 Nov 2004

RE: Global Variables - What is in Memory?
Justin Luster 17:18 on 05 Nov 2004

RE: Global Variables - What is in Memory?
Perrin Harkins 17:26 on 05 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52