You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/12/22 06:18:19 UTC

RE: Clarification of PERL_STASH_POST_DATA

On Wed, 8 Nov 2000, Paul J. Lucas wrote:

> On Wed, 8 Nov 2000, Geoffrey Young wrote:
> 
> > ... Apache::RequestNotes may be able to help - it basically does
> > cookie/get/post/upload parsing during request init and then stashes
> > references to the data in pnotes.  The result is a consistent interface to
> > the data across all handlers (which is the exact reason this module came
> > about)
> 
> 	This is /exactly/ right.  The only caveat is that its API is
> 	different from Apache::Request.  It Would Be Nice(TM) if the
> 	module subclassed itself off of Apache::Request so that the
> 	Apache::Request API would Do The Right Thing(TM).
> 
> > it requires Doug's libapreq and probably a few code changes, but it may be
> > somewhat helpful...
> 
> 	Such functionality should imply be absorbed into
> 	Apache::Request.

matt has submitted a patch for Apache::Request->instance, you can drop
this in and use it until the next release.

 sub Apache::Request::instance {
     my $class = shift;
     my $r = shift;
     if (my $apreq = $r->pnotes('apreq')) {
         return $apreq;
     }
     my $new_req = $class->new($r);
     $r->pnotes('apreq', $new_req);
     return $new_req;
 }

the POST_DATA hack isn't even worth talking about.  and shouldn't be
documented, where did you find that, the guide?