perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wyllie <wyl...@dilex.net>
Subject Re: Apache2::Cookie - can't find cookie_clas.al
Date Fri, 20 May 2005 12:59:33 GMT


Joe Schaefer wrote:

>Andrew Wyllie <wyllie@dilex.net> writes:
>
>  
>
>>my $jar = Apache2::Cookie::Jar->new( $r, VALUE_CLASS =>
>>"Alta::Cookies::Cookie" );
>>    
>>
>
>Oops, looks like I b0rked that API in 2.05.  Here's the preferred
>aproach now:
>
>    my $req = APR::Request::Apache2->handle($r);
>    my $jar = $req->jar;
>    $jar->cookie_class("Alta::Cookies::Cookie");
>    # use $jar as if it were $jar->cookies from 2.04-dev.
>  
>

Thanks Joe - for the fix and the quick response!  That did the trick. 
Now I'm going to spend some time exploring the APR::Request APIs.  It looks
really good to me so far...

Thanks,
Andrew

>  
>
>>I have tried looking through the tests for libapreq, but I could not
>>find a reference to Apache2::Cookie::Jar.
>>    
>>
>
>That package should've died anyways, since we killed off the 
>apreq_jar_t struct in 2.05-dev.  In any case, IMO you're 
>better off learning the APR::Request APIs as they are 
>emerging now.  The core is here:
>
> # like Apache2::Request->new
>  my $req = APR::Request::Apache2->handle($r, ...);
>
>  my $args = $req->args; # the args table
>  my $body = $req->body; # the body table
>  my $param = $req->param; # the param (body + args) table
>  my $upload = $req->upload; # upload table requires APR::Request::Param
>
># each of the tables above are read-only (fast!) tiehash refs, 
># and the values are simple scalars.  But you can upgrade them
># to full params by changing the param_class, ie:
>
>  $body->param_class("APR::Request::Param");
>
># that way you can call methods on each value, $v->is_tainted($on_off),
># $v->charset($number), etc.  Also, by turning off the is_tainted flag,
># that also means you are trusting apreq with the charset 
># interpretation.  That means you can do a single taint-checking 
># sweep across the params in some early section of your code, and have
># later calls to $req->param("foo") marked with its proper utf8 flags.
>
>  
>

Mime
View raw message