Merge branch 'ancona' into ancona-trace
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index d48d9a4..2aa6b11 100644 (file)
@@ -22,25 +22,6 @@ 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
@@ -162,6 +143,11 @@ sub finalize_body {
               close $body;
           }
           else {
+              
+              # Case where body was set afgter calling ->write.  We'd prefer not to
+              # support this, but I can see some use cases with the way most of the
+              # views work.
+
               $self->write($c, $body );
           }
         }
@@ -204,8 +190,7 @@ sub finalize_cookies {
             )
         );
         if (!defined $cookie) {
-            $c->log->warn("undef passed in '$name' cookie value - not setting cookie")
-                if $c->debug;
+            $c->trace(1, "undef passed in '$name' cookie value - not setting cookie");
             next;
         }
 
@@ -258,6 +243,8 @@ sub finalize_error {
     }
 
     my ( $title, $error, $infos );
+    ## For now we keep debug mode for turning on the default
+    ## debugging error screen - jnap.
     if ( $c->debug ) {
 
         # For pretty dumps
@@ -648,7 +635,6 @@ 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});
 }