sub execute {
my ( $c, $class, $code ) = @_;
- $class = $c->comp($class) || $class;
+ $class = $c->components->{$class} || $class;
$c->state(0);
my $callsub = ( caller(1) )[3];
$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;
return $status;
}
+=item $c->finalize_output
+
+alias to finalize_body
+
=item $c->finalize_body
Finalize body.
$name = '';
}
- $c->res->output( <<"" );
+ $c->res->body( <<"" );
<html>
<head>
<title>$title</title>
sub finalize_headers { }
-=item $c->handler( $class, $r )
+=item $c->handler( $class, $engine )
Handles the request.
return $status;
}
-=item $c->prepare($r)
+=item $c->prepare($engine)
Turns the engine-specific request( Apache, CGI ... )
into a Catalyst context .
=cut
sub prepare {
- my ( $class, $r ) = @_;
+ my ( $class, $engine ) = @_;
my $c = bless {
request => Catalyst::Request->new(
$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;
$t->setCols( 'Key', 'Value' );
$t->setColWidth( 'Key', 37, 1 );
$t->setColWidth( 'Value', 36, 1 );
- for my $key ( keys %{ $c->req->params } ) {
- my $value = $c->req->params->{$key} || '';
+ for my $key ( sort keys %{ $c->req->params } ) {
+ my $param = $c->req->params->{$key};
+ my $value = defined($param) ? $param : '';
$t->addRow( $key, $value );
}
$c->log->debug( 'Parameters are', $t->draw );