httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject RE: Subclassing Apache::Request
Date Tue, 29 Apr 2003 14:45:27 GMT

 > The other idea that came back from the mod_perl mailing list was to
 > aggregate:
 >
 >     sub new {
 >         my($class, @args) = @_;
 >         return bless { _r => Apache::Request->new(@args) }, $class;
 >     }
 >
 > but that would then require an AUTOLOAD() method or similar
 > to delegate
 > Apache::Request methods to the contained Apache::Request
 > object; this is
 > even more annoying than my "re-blessing" suggestion above.

this happens automagically.

as I pointed out before

http://www.modperlcookbook.org/code/ch13/Cookbook/CookieAuthentication.pm

is an example of subclassing Apache::Request.  the subclass is used in

http://www.modperlcookbook.org/code/ch13/Cookbook/AuthHandler.pm

note here that AuthHandler.pm calls get_cookie_auth_pw(), which is 
implemented in the subclass.  it also calls is_initial_req(), which it 
inherits from Apache::Request, who inherits it from Apache.pm.

HTH

--Geoff


Mime
View raw message