[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl-dev
Subject:    Re: ModPerl::MethodLookup questionalbe recommendation
From:       Geoffrey Young <geoff () modperlcookbook ! org>
Date:       2005-07-29 0:13:43
Message-ID: 42E974B7.3050508 () modperlcookbook ! org
[Download RAW message or body]



Vivek Khera wrote:
> I'm converting my main app to mp2.  The following advice seems 
> incorrect to me:
> 
> % perl -MModPerl::MethodLookup -e print_method is_main
> 'is_main' is not a part of the mod_perl 2.0 API
> use 'main' instead.  not in the Apache 2.0 API
> To use method 'main' add:
>         use Apache2::RequestRec ();
> 
> 
> I believe the more appropriate replacement of is_main() would be 
> is_initial_req() from Apache2::RequestUtil().

in 1.3 is_main() was used to specify the initial request in a series of
subrequests.  is_initial_req() specifies _only_ the initial request coming
from the client.  in other words, a single browser request results in one
and only one place where is_initial_req() is true, while it could
potentially create several instances where is_main() is true.

so... way back in the day people used to use $r->is_main() to spot the place
where they could, say, call $r->notes and get the "main" request.  in mp2 I
guess you would do $r->main->notes and avoid the call to is_main() at all.

anyway, I guess all I'm saying is that I don't think is_initial_req() ought
to be the replacement for is_main() - is_initial_req() is very specific and
still exists with the same functionality in 2.0.  if someone was using
is_main() in mp2 it's not necessarily true that is_initial_req() is what
they need.

of course main() isn't what they need either...

:)

--Geoff

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic