perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <>
Subject Re: [mp2] porting/co-existence questions
Date Sun, 07 Aug 2005 23:29:49 GMT
Thomas Hilbig wrote:
>>>Also, the mp2 User's Guide (section 10.9.1) says
>>> now takes $r as an argument to its new()
>>>function.  What benefit is this?  Is it required? 
>>For the most part its optional.
>>You may need to look at PerlGlobalRequest
> I'm still confused why this is optional in 
> Does it save some cycles by avoiding having to
> sniff around for the Apache requestor?

  if (ref($initializer[0])
       && (UNIVERSAL::isa($initializer[0],'Apache')
          )) {
     $self->r(shift @initializer);
if ($MOD_PERL) {
     if ($MOD_PERL == 1) {
       $self->r(Apache->request) unless $self->r;
       my $r = $self->r;
     else {
       # XXX: once we have the new API
       # will do a real PerlOptions -SetupEnv check
       $self->r(Apache2::RequestUtil->request) unless $self->r;
       my $r = $self->r;
       $r->subprocess_env unless exists $ENV{REQUEST_METHOD};
     undef $NPH;

After CGI->new() or CGI->new($r) is called from here on out internall it 
will just use $self->r whenver an Apache2::Request object is needed.
I'm not entirely sure it will say you speed passing or not passing it. 
The only benefit I see is that you could pass a subclassed version in.

Though I may be missing something.


     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
Philip M. Gollucci ( 301.254.5198
Consultant /
Senior Developer / Liquidity Services, Inc.

View raw message