X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=a2fb6accb188706c0c13b61b260ce82bef652306;hb=b607f8a0c170499a37baf05a23e8d47a193af768;hp=dd4607ad17d4a0b08cc58efe0343b3ffc2d1e842;hpb=8df786038087f3c31a62dc7163c81b1f69270447;p=catagits%2FCatalyst-Runtime.git
diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm
index dd4607a..a2fb6ac 100644
--- a/lib/Catalyst.pm
+++ b/lib/Catalyst.pm
@@ -61,7 +61,7 @@ __PACKAGE__->response_class('Catalyst::Response');
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.7003';
+our $VERSION = '5.7006';
sub import {
my ( $class, @arguments ) = @_;
@@ -501,8 +501,11 @@ Gets a L
Welcome to the wonderful world of Catalyst.
+ Welcome to the world of Catalyst.
This MVC
framework will make web development something you had
never expected it to be: Fun, rewarding, and quick. That really depends on what you want to do.
We do, however, provide you with a few starting points. If you want to jump right into web development with Catalyst
- you might want to check out the documentation.
+ you might want want to start with a tutorial.perldoc Catalyst::Manual::Intro
-perldoc Catalyst::Manual::Tutorial
-perldoc Catalyst::Manual
perldoc Catalyst::Manual::Tutorial ++
Afterwards you can go on to check out a more complete look at our features.
+
+perldoc Catalyst::Manual::Intro
+
+
Next it's time to write an actual application. Use the helper scripts to generate controllers, @@ -1294,6 +1318,24 @@ sub finalize { $c->finalize_body; } + + if ($c->debug) { + my $elapsed = sprintf '%f', tv_interval($c->stats->getNodeValue); + my $av = sprintf '%.3f', ( $elapsed == 0 ? '??' : ( 1 / $elapsed ) ); + + my $t = Text::SimpleTable->new( [ 62, 'Action' ], [ 9, 'Time' ] ); + $c->stats->traverse( + sub { + my $action = shift; + my $stat = $action->getNodeValue; + $t->row( ( q{ } x $action->getDepth ) . $stat->{action} . $stat->{comment}, + $stat->{elapsed} || '??' ); + } + ); + + $c->log->info( + "Request took ${elapsed}s ($av/s)\n" . $t->draw . "\n" ); + } return $c->response->status; } @@ -1422,35 +1464,15 @@ sub handle_request { my $status = -1; eval { if ($class->debug) { - my $start = [gettimeofday]; - my $c = $class->prepare(@arguments); - $c->stats(Tree::Simple->new); - $c->dispatch; - $status = $c->finalize; - - my $elapsed = tv_interval $start; - $elapsed = sprintf '%f', $elapsed; - my $av = sprintf '%.3f', - ( $elapsed == 0 ? '??' : ( 1 / $elapsed ) ); - my $t = Text::SimpleTable->new( [ 62, 'Action' ], [ 9, 'Time' ] ); - - $c->stats->traverse( - sub { - my $action = shift; - my $stat = $action->getNodeValue; - $t->row( ( q{ } x $action->getDepth ) . $stat->{action} . $stat->{comment}, - $stat->{elapsed} || '??' ); - } - ); - - $class->log->info( - "Request took ${elapsed}s ($av/s)\n" . $t->draw ); - } - else { - my $c = $class->prepare(@arguments); - $c->dispatch; - $status = $c->finalize; + my $secs = time - $START || 1; + my $av = sprintf '%.3f', $COUNT / $secs; + my $time = localtime time; + $class->log->info("*** Request $COUNT ($av/s) [$$] [$time] ***"); } + + my $c = $class->prepare(@arguments); + $c->dispatch; + $status = $c->finalize; }; if ( my $error = $@ ) { @@ -1504,20 +1526,17 @@ sub prepare { } ); + if ( $c->debug ) { + $c->stats(Tree::Simple->new([gettimeofday])); + $c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); + } + # For on-demand data $c->request->{_context} = $c; $c->response->{_context} = $c; weaken( $c->request->{_context} ); weaken( $c->response->{_context} ); - if ( $c->debug ) { - my $secs = time - $START || 1; - my $av = sprintf '%.3f', $COUNT / $secs; - my $time = localtime time; - $c->log->info("*** Request $COUNT ($av/s) [$$] [$time] ***"); - $c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); - } - # Allow engine to direct the prepare flow (for POE) if ( $c->engine->can('prepare') ) { $c->engine->prepare( $c, @arguments );