X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=5def763c1ce5844404d6f3ed9d7c6bb0a8974275;hp=0fa02b549399785018b85b7ad3c7a168e6b4df94;hb=b0bb11ec8c056e043e87cd7733125ffc9d9bcfb0;hpb=11bd4e3eaa29685c44318041381621e79c4a5f44 diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 0fa02b5..5def763 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -55,56 +55,7 @@ sub dispatch { my ( $self, $c ) = @_; if ( $c->action ) { - - my @containers = $self->get_containers( $c->namespace ); - my %actions; - foreach my $name (qw/begin auto end/) { - - # Go down the container list representing each part of the - # current namespace inheritance tree, grabbing the actions hash - # of the ActionContainer object and looking for actions of the - # appropriate name registered to the namespace - - $actions{$name} = [ - map { $_->{$name} } - grep { exists $_->{$name} } - map { $_->actions } @containers - ]; - } - - # Errors break the normal flow and the end action is instantly run - my $error = 0; - - # Execute last begin - $c->state(1); - if ( my $begin = @{ $actions{begin} }[-1] ) { - $begin->execute($c); - $error++ if scalar @{ $c->error }; - } - - # Execute the auto chain - my $autorun = 0; - for my $auto ( @{ $actions{auto} } ) { - last if $error; - $autorun++; - $auto->execute($c); - $error++ if scalar @{ $c->error }; - last unless $c->state; - } - - # Execute the action or last default - my $mkay = $autorun ? $c->state ? 1 : 0 : 1; - if ($mkay) { - unless ($error) { - $c->action->execute($c); - $error++ if scalar @{ $c->error }; - } - } - - # Execute last end - if ( my $end = @{ $actions{end} }[-1] ) { - $end->execute($c); - } + $c->forward( join( '/', '', $c->namespace, '_DISPATCH' ) ); } else { @@ -454,7 +405,7 @@ sub setup_actions { while ( my $class = shift @cache ) { $classes{$class}++; - for my $isa ( @{"$comp\::ISA"} ) { + for my $isa ( @{"$class\::ISA"} ) { next if $classes{$isa}; push @cache, $isa; $classes{$isa}++; @@ -497,6 +448,9 @@ sub setup_actions { for my $action ( keys %{$node} ) { my $action_obj = $node->{$action}; + next + if ( ( $action =~ /^_.*/ ) + && ( !$c->config->{show_internal_actions} ) ); $privates->addRow( "$prefix$action", $action_obj->class ); }