perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject Re: [PATCH[ Apache::DBI allow to work wi tth mp2 after rename
Date Sun, 10 Apr 2005 03:20:00 GMT
> 
> --- DBI.pm	Sat Apr  9 22:14:03 2005
> +++ DBI.pm.new	Sat Apr  9 22:17:05 2005
> @@ -193,8 +193,8 @@
>  
>  
>  # prepare menu item for Apache::Status
> -
> -Apache::Status->menu_item(
> +if ($ENV{MOD_PERL_API_VERSION} == 2) {
> +	Apache2::Status->menu_item(
>      'DBI' => 'DBI connections',
>      sub {
>          my($r, $q) = @_;
> @@ -205,10 +205,25 @@
>          push @s, '</TABLE>';
>          return \@s;
>     }
> -
> -) if ($INC{'Apache.pm'}                      # is Apache.pm loaded?
> +	) if Apache2::Module::loaded('Apache2::Status');
> +}
> +else {
> +	## mp 1
> +	Apache::Status->menu_item(
> +    'DBI' => 'DBI connections',
> +    sub {
> +        my($r, $q) = @_;
> +        my(@s) = qw(<TABLE><TR><TD>Datasource</TD><TD>Username</TD></TR>);
> +        for (keys %Connected) {
> +            push @s, '<TR><TD>', join('</TD><TD>', (split($;,
$_))[0,1]), "</TD></TR>\n";
> +        }
> +        push @s, '</TABLE>';
> +        return \@s;
> +   }
> +	) if ($INC{'Apache.pm'}                     # is Apache.pm loaded?
>        and Apache->can('module')               # really?
>        and Apache->module('Apache::Status'));  # Apache::Status too?
> +}
>  
>  1;
This only gets it to appear in the Apache::Status menu.
I believe I'll have a patch to use Apache2::ServerRecUtil
in the rest shortly.

-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message