httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [multi-env] perl glue implications
Date Thu, 03 Feb 2005 01:40:36 GMT
Joe Schaefer wrote:
[...]
> The implications for the perl glue will all stem from this 
> fundamental change in the C API:
[...]
> ultimate goal:      apreq_handle_t *req = apreq_handle_apache2(r);
> 
> 
> So all requests for parsed data will go through the common apreq_handle_t, 
> instead of having separate structs for cookies and params.  What I think
> this will bubble up into, from the perl glue standpoint, is a new barebones
> APR:: heirarchy that might work like so
> 
> 
>       my $req = APR::Request->new($r, MODULE => "Apache2"); # apreq_handle_t

which should probably be abstracted into:

   my $req = Apache2::Request->new($r);

with Apache2::Request being a subclass (or Apache::Request, whatever it is).

>       my $jar = $req->jar();        # an APR::Table-derived object
>       my $foo_cookie = $jar->{foo}; # an APR::Cookie, wraps apreq_cookie_t
>       $foo_cookie->expires(200);    # APR::Cookie::expires method
>       $foo_cookie->bake($req);      # bake the cookie, $req arg needed now
> 
>       my @foo_uploads = grep {$_->bb} $req->body("foo"); # APR::Param objs
>       my $foo_filename = "$foo_uploads[0]"; # same as $foo_params[0]->value
>       my $foo_value = $req->param("foo"); # ordinary (unblessed) scalar
> 
> 
> The API defects in trunk's Apache::Cookie and Apache::Request are IMO
> best addressed by creating those modules out of these new bareboned
> APR:: classes.  That way the new stuff goes into the new APR:: modules,
> and our old Apache::* modules can aim towards better 1.x compatibility.
>
> At least that's how I see things falling into place on the perl side,
> once the multi-env C API stabilizes.

Sounds good to me.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message