X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=ce8e940ecd7c45f64bf61865da227ce9bc0ee1b5;hb=502619e59524272fc07491f9d2d6958304df3fa4;hp=4d25d70f5dc1384ffef6211fec8e58c06a95fcec;hpb=7e5adeddb832463a4c4028b4ea2ec9fdf1ddbdad;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 4d25d70..ce8e940 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -94,9 +94,8 @@ sub action { if ( my $p = $self->actions->{plain}->{$action} ) { return [$p] } elsif ( my $r = $self->actions->{regex}->{$action} ) { return [$r] } else { - while ( my ( $regex, $name ) = - each %{ $self->actions->{compiled} } ) - { + for my $regex ( keys %{ $self->actions->{compiled} } ) { + my $name = $self->actions->{compiled}->{$regex}; if ( $action =~ $regex ) { my @snippets; for my $i ( 1 .. 9 ) { @@ -475,12 +474,22 @@ sub prepare { } $c->prepare_request($r); $c->prepare_path; - my $path = $c->request->path; - $c->log->debug(qq/Requested path "$path"/) if $c->debug; $c->prepare_cookies; $c->prepare_headers; + my $method = $c->req->method; + my $path = $c->req->path; + $c->log->debug(qq/"$method" request for "$path"/) if $c->debug; $c->prepare_action; $c->prepare_parameters; + + if ( $c->debug && keys %{ $c->req->params } ) { + my @params; + for my $key ( keys %{ $c->req->params } ) { + my $value = $c->req->params->{$key} || ''; + push @params, "$key=$value"; + } + $c->log->debug( 'Parameters are "' . join( ' ', @params ) . '"' ); + } $c->prepare_uploads; return $c; } @@ -517,8 +526,6 @@ sub prepare_action { $c->log->debug(qq/Requested action "$path"/) if $c->debug; } $c->req->match($path); - $c->log->debug( 'Arguments are "' . join( '/', @args ) . '"' ) - if ( $c->debug && @args ); last; } unshift @args, pop @path; @@ -536,6 +543,8 @@ sub prepare_action { $c->log->debug('Using default action') if $c->debug; } } + $c->log->debug( 'Arguments are "' . join( '/', @args ) . '"' ) + if ( $c->debug && @args ); } =head3 prepare_cookies;