X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=257a8cd3f71c9221ea7bd04fc65c8072249c9bea;hb=5d2c7203d35650cf3dc99a7b6d6e6659ebc7d559;hp=fb80e112a5eebf05fadcc81b4304fcc66cdfa430;hpb=06e1b6164a2c9d7b463f358b0d1934ef83a82845;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index fb80e11..257a8cd 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;