From: Henry Van Styn Date: Sat, 9 Aug 2014 15:10:08 +0000 (-0400) Subject: Revert changes made to Engine.pm in 1ef7eeb (5.90070) X-Git-Tag: 5.90071~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=52af51596d0da1e9b503e7ba57443a69b409e358 Revert changes made to Engine.pm in 1ef7eeb (5.90070) In 1ef7eeb ("removed old PSGI Engine backcompat ") some back compat code was removed from lib/Catalyst/Engine.pm. But, this backcompat code is apparently still needed and being used out in the wild. This breaks the tests of at least: Catalyst-Plugin-Authentication-0.10023 t/live_app_remote1.t This commit restores the lines removed, going back to the state of the last production release, 5.90065: git checkout 5.90065 -- lib/Catalyst/Engine.pm Also re-applied change in 08680694151 --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 56e5b1d..927d363 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -22,6 +22,25 @@ use namespace::clean -except => 'meta'; # Amount of data to read from input on each pass our $CHUNKSIZE = 64 * 1024; +# XXX - this is only here for compat, do not use! +has env => ( is => 'rw', writer => '_set_env' ); +my $WARN_ABOUT_ENV = 0; +around env => sub { + my ($orig, $self, @args) = @_; + if(@args) { + warn "env as a writer is deprecated, you probably need to upgrade Catalyst::Engine::PSGI" + unless $WARN_ABOUT_ENV++; + return $self->_set_env(@args); + } + return $self->$orig; +}; + +# XXX - Only here for Engine::PSGI compat +sub prepare_connection { + my ($self, $ctx) = @_; + $ctx->request->prepare_connection; +} + =head1 NAME Catalyst::Engine - The Catalyst Engine @@ -635,6 +654,7 @@ sub prepare_request { my ($self, $ctx, %args) = @_; $ctx->log->psgienv($args{env}) if $ctx->log->can('psgienv'); $ctx->request->_set_env($args{env}); + $self->_set_env($args{env}); # Nasty back compat! $ctx->response->_set_response_cb($args{response_cb}); }