X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=9f683bb76af05b947db198865fe34b19737c5f4f;hp=37dca91af3994ae37aba4ad807c2a8c668cc6bf4;hb=ddcd2fc4728111853841078cc5d9a117b993ea96;hpb=c2c8d3cb922518ace5a0d35cd43832baaa12e6a9 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 37dca91..9f683bb 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -46,7 +46,16 @@ has state => (is => 'rw', default => 0); has stats => (is => 'rw'); has action => (is => 'rw'); has counter => (is => 'rw', default => sub { {} }); -has request => (is => 'rw', default => sub { $_[0]->request_class->new({}) }, required => 1, lazy => 1); +has request => ( + is => 'rw', + default => sub { + my $self = shift; + my %p; + $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; + $self->request_class->new(\%p); + }, + lazy => 1, +); has response => (is => 'rw', default => sub { $_[0]->response_class->new({}) }, required => 1, lazy => 1); has namespace => (is => 'rw'); @@ -84,7 +93,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90005'; +our $VERSION = '5.90006'; sub import { my ( $class, @arguments ) = @_; @@ -1983,6 +1992,11 @@ etc.). =cut +has _uploadtmp => ( + is => 'ro', + predicate => '_has_uploadtmp', +); + sub prepare { my ( $class, @arguments ) = @_; @@ -1991,7 +2005,8 @@ sub prepare { # into the application. $class->context_class( ref $class || $class ) unless $class->context_class; - my $c = $class->context_class->new({}); + my $uploadtmp = $class->config->{uploadtmp}; + my $c = $class->context_class->new({ $uploadtmp ? (_uploadtmp => $uploadtmp) : ()}); # For on-demand data $c->request->_context($c); @@ -2012,8 +2027,6 @@ sub prepare { $c->prepare_request(@arguments); $c->prepare_connection; $c->prepare_query_parameters; - $c->prepare_headers; - $c->prepare_cookies; $c->prepare_path; # Prepare the body for reading, either by prepare_body @@ -2105,25 +2118,11 @@ Prepares connection. sub prepare_connection { my $c = shift; - $c->engine->prepare_connection( $c, @_ ); + # XXX - This is called on the engine (not the request) to maintain + # Engine::PSGI back compat. + $c->engine->prepare_connection($c); } -=head2 $c->prepare_cookies - -Prepares cookies. - -=cut - -sub prepare_cookies { my $c = shift; $c->engine->prepare_cookies( $c, @_ ) } - -=head2 $c->prepare_headers - -Prepares headers. - -=cut - -sub prepare_headers { my $c = shift; $c->engine->prepare_headers( $c, @_ ) } - =head2 $c->prepare_parameters Prepares parameters. @@ -2405,7 +2404,7 @@ $c->request. You must handle all body parsing yourself. =cut -sub read { my $c = shift; return $c->engine->read( $c, @_ ) } +sub read { my $c = shift; return $c->request->read( @_ ) } =head2 $c->run