X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=d1716efd6703f41a28a54eaf319509c3485db4f5;hb=6d1ab9154b299ce3697ec69d4ffd10dda4c07c0e;hp=fb80e112a5eebf05fadcc81b4304fcc66cdfa430;hpb=06e1b6164a2c9d7b463f358b0d1934ef83a82845;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index fb80e11..d1716ef 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -126,7 +126,7 @@ Errors are available via $c->error. sub execute { my ( $c, $class, $code ) = @_; - $class = $c->comp($class) || $class; + $class = $c->components->{$class} || $class; $c->state(0); my $callsub = ( caller(1) )[3]; @@ -179,13 +179,13 @@ sub finalize { $c->finalize_error; } - if ( !$c->response->output && $c->response->status !~ /^(1|3)\d\d$/ ) { + if ( !$c->response->body && $c->response->status !~ /^(1|3)\d\d$/ ) { $c->finalize_error; } - if ( $c->response->output && !$c->response->content_length ) { + if ( $c->response->body && !$c->response->content_length ) { use bytes; # play safe with a utf8 aware perl - $c->response->content_length( length $c->response->output ); + $c->response->content_length( length $c->response->body ); } my $status = $c->finalize_headers; @@ -193,6 +193,10 @@ sub finalize { return $status; } +=item $c->finalize_output + +alias to finalize_body + =item $c->finalize_body Finalize body. @@ -271,7 +275,7 @@ sub finalize_error { $name = ''; } - $c->res->output( <<"" ); + $c->res->body( <<"" ); $title @@ -335,7 +339,7 @@ Finalize headers. sub finalize_headers { } -=item $c->handler( $class, $r ) +=item $c->handler( $class, $engine ) Handles the request. @@ -391,7 +395,7 @@ into a Catalyst context . =cut sub prepare { - my ( $class, $r ) = @_; + my ( $class, $engine ) = @_; my $c = bless { request => Catalyst::Request->new( @@ -420,7 +424,7 @@ sub prepare { $c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); } - $c->prepare_request($r); + $c->prepare_request($engine); $c->prepare_path; $c->prepare_headers; $c->prepare_cookies; @@ -459,7 +463,8 @@ sub prepare { $t->setColWidth( 'Key', 37, 1 ); $t->setColWidth( 'Value', 36, 1 ); for my $key ( keys %{ $c->req->params } ) { - my $value = $c->req->params->{$key} || ''; + my $param = $c->req->params->{$key}; + my $value = defined($param) ? $param : ''; $t->addRow( $key, $value ); } $c->log->debug( 'Parameters are', $t->draw );