X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=b959d7ccdaee03edd8d51309b74ca2e110bdaefb;hp=559f76b0966ddf0cc21987b34b87e0c3c93a7207;hb=0df490ef10f0a2deaa3b7950e721fa44659de860;hpb=0ee04045a413235cb1474efcb490039691ef78e6 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 559f76b..b959d7c 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -52,20 +52,30 @@ has request => ( is => 'rw', default => sub { my $self = shift; - my %p = ( _log => $self->log ); - $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; - $self->request_class->new(\%p); + $self->request_class->new($self->_build_request_class_construction_parameters); }, lazy => 1, ); +sub _build_request_class_construction_parameters { + my $self = shift; + my %p = ( _log => $self->log ); + $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; + \%p; +} + has response => ( is => 'rw', default => sub { my $self = shift; - $self->response_class->new({ _log => $self->log }); + $self->response_class->new($self->_build_response_class_construction_parameters); }, lazy => 1, ); +sub _build_response_class_construction_parameters { + my $self = shift; + { _log => $self->log }; +} + has namespace => (is => 'rw'); sub depth { scalar @{ shift->stack || [] }; } @@ -102,7 +112,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90015'; +our $VERSION = '5.90016'; sub import { my ( $class, @arguments ) = @_;