Re: [BUG?] Problems with Apache::Status and B::TerseSize

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

From: Geoffrey Young
Subject: Re: [BUG?] Problems with Apache::Status and B::TerseSize
Date: 18:24 on 10 Nov 2004

> Having configured Apache::Status correctly and getting listings for the
> various modules which are loaded, I came across a slight bug in
> Apache::Status (line 102) where if there isn't a $VERSION in a module
> Apache::Status barfs, I corrected this with a small fix from
> 
>    # if !$opt we skip the testing for the option
>    return 0 if $opt && !status_config($r, $opt);
>    return 0 unless eval { require $file };
>    return 0 unless $module->VERSION >= $version;
> 
> to
> 
>    # if !$opt we skip the testing for the option
>    return 0 if $opt && !status_config($r, $opt);
>    return 0 unless eval { require $file };
>    return 0 unless defined($module->VERSION);
>    return 0 unless $module->VERSION >= $version;

from the looks of it, that function is for internal use only - it only
checks for the modules in $required, all of which should have versions.  but
stas would know more...

> I imagine this is because the hooks into Apache::Status in B::TerseSize
> are somewhat out of date with regards to mod_perl 2, has anyone come
> across this problem previously and come up with a solution ?

either use Apache::compat, or change

  Apache::Status->menu_item(
      'status_memory_usage' => "Memory Usage",
      \&status_memory_usage,
  ) if IS_MODPERL and Apache->module("Apache::Status");

to (the untested :)

  Apache::Status->menu_item(
      'status_memory_usage' => "Memory Usage",
      \&status_memory_usage,
  ) if IS_MODPERL and eval { require Apache::Module;
                             Apache::Module::loaded("Apache::Status");
                           };

or somesuch.

HTH

--Geoff

        -- 
        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

Re: [BUG?] Problems with Apache::Status and B::TerseSize
Geoffrey Young 18:24 on 10 Nov 2004

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