X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=ba926cb0ba48969a2bb5cbc8b1bdd652b6cf0f9a;hb=4b19b4f34b30d3a95c3a0a56147358d1efb93f0b;hp=ec6c0f32b12ea4c45250d19b97eab6e73ce5cafd;hpb=6196207f8747abf0cb3ef03152102804927db557;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ec6c0f3..ba926cb 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -373,11 +373,11 @@ sub handler ($$) { for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) { $c->state( $c->execute( @{ $begin->[0] } ) ); } - for my $result ( @{ $c->get_action( $action, $default ) } ) { + for my $result ( @{ $c->get_action( $action, $default ) }[-1] ) { $c->state( $c->execute( @{ $result->[0] } ) ); last unless $default; } - for my $end ( @{ $c->get_action( 'end', $namespace ) } ) { + for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) { $c->state( $c->execute( @{ $end->[0] } ) ); } } @@ -444,8 +444,8 @@ sub prepare { } $c->prepare_request($r); $c->prepare_path; - $c->prepare_cookies; $c->prepare_headers; + $c->prepare_cookies; $c->prepare_connection; my $method = $c->req->method || ''; my $path = $c->req->path || ''; @@ -638,11 +638,11 @@ sub set_action { my %flags; for my $attr ( @{$attrs} ) { - if ( $attr =~ /^Local$/ ) { $flags{local}++ } - elsif ( $attr =~ /^Global$/ ) { $flags{global}++ } - elsif ( $attr =~ /^Path\((.+)\)$/i ) { $flags{path} = $1 } - elsif ( $attr =~ /^Private$/i ) { $flags{private}++ } - elsif ( $attr =~ /Regex\((.+)\)$/i ) { $flags{regex} = $1 } + if ( $attr =~ /^(Local|Relative)$/ ) { $flags{local}++ } + elsif ( $attr =~ /^(Global|Absolute)$/ ) { $flags{global}++ } + elsif ( $attr =~ /^Path\((.+)\)$/i ) { $flags{path} = $1 } + elsif ( $attr =~ /^Private$/i ) { $flags{private}++ } + elsif ( $attr =~ /^(Regex|Regexp)\((.+)\)$/i ) { $flags{regex} = $2 } } return unless keys %flags; @@ -809,9 +809,11 @@ sub _prefix { sub _class2prefix { my $class = shift || ''; - $class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/; - my $prefix = lc $2 || ''; - $prefix =~ s/\:\:/\//g; + my $prefix; + if ($class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/) { + $prefix = lc $2; + $prefix =~ s/\:\:/\//g; + } return $prefix; }