X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=8e7c4fee113a0888ea66e6c1cf5f5cdd67f1d56c;hb=02c4d5985fe1c908c75639a02a469136bcd9851e;hp=8ad1b7d58bcd24bb9ccb3ec2b8554e5bfabfa564;hpb=6561feaea6cb3f0a84e97fc6f2bc55788fe8c393;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 8ad1b7d..8e7c4fe 100755 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -54,7 +54,6 @@ use Class::Load 'load_class'; BEGIN { require 5.008003; } has stack => (is => 'ro', default => sub { [] }); -#has stash => (is => 'rw', default => sub { {} }); has state => (is => 'rw', default => 0); has stats => (is => 'rw'); has action => (is => 'rw'); @@ -127,7 +126,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90069_001'; +our $VERSION = '5.90069_002'; sub import { my ( $class, @arguments ) = @_; @@ -495,36 +494,11 @@ Catalyst). # stash is automatically passed to the view for use in a template $c->forward( 'MyApp::View::TT' ); - - -around stash => sub { - my $orig = shift; - my $c = shift; - my $stash = $orig->($c); - if (@_) { - my $new_stash = @_ > 1 ? {@_} : $_[0]; - croak('stash takes a hash or hashref') unless ref $new_stash; - foreach my $key ( keys %$new_stash ) { - $stash->{$key} = $new_stash->{$key}; - } - } - - return $stash; -}; - =cut sub stash { my $c = shift; - my $stash = Catalyst::Middleware::Stash->get($c->req->env); - if(@_) { - my $new_stash = @_ > 1 ? {@_} : $_[0]; - croak('stash takes a hash or hashref') unless ref $new_stash; - foreach my $key ( keys %$new_stash ) { - $stash->{$key} = $new_stash->{$key}; - } - } - return $stash; + return Catalyst::Middleware::Stash::get_stash($c->req->env)->(@_); } =head2 $c->error @@ -2198,9 +2172,7 @@ Prepares connection. sub prepare_connection { my $c = shift; - # XXX - This is called on the engine (not the request) to maintain - # Engine::PSGI back compat. - $c->engine->prepare_connection($c); + $c->request->prepare_connection($c); } =head2 $c->prepare_cookies