X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=a75f43bfe33739b796b343c1e2855eeafea584ac;hb=c2bdae884dfda03d5d7c24c74d59eb24c25855b6;hp=fe7a6d283d904e48df2e0ca4684f323c9e51ef8f;hpb=aa61c19093ccde10f79f746daee1387748590f43;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index fe7a6d2..a75f43b 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -49,7 +49,6 @@ our $COUNT = 1; our $START = time; our $RECURSION = 1000; our $DETACH = "catalyst_detach\n"; -our $GO = "catalyst_go\n"; __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class @@ -64,7 +63,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.7099_02'; +our $VERSION = '5.7014'; sub import { my ( $class, @arguments ) = @_; @@ -328,20 +327,6 @@ When called with no arguments it escapes the processing chain entirely. sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) } -=head2 $c->go( $action [, \@arguments ] ) - -=head2 $c->go( $class, $method, [, \@arguments ] ) - -Almost the same as C, but does a full dispatch, instead of just -calling the new C<$action> / C<$class-E$method>. This means that C, -C and the method you go to is called, just like a new request. - -C<$c-Estash> is kept unchanged. - -=cut - -sub go { my $c = shift; $c->dispatcher->go( $c, @_ ) } - =head2 $c->response =head2 $c->res @@ -452,16 +437,10 @@ sub _comp_search_prefixes { # regexp fallback $query = qr/$name/i; - @result = map { $c->components->{ $_ } } grep { $eligible{ $_ } =~ m{$query} } keys %eligible; - - # no results? try against full names - if( !@result ) { - @result = map { $c->components->{ $_ } } grep { m{$query} } keys %eligible; - } + @result = grep { $eligible{ $_ } =~ m{$query} } keys %eligible; # don't warn if we didn't find any results, it just might not exist if( @result ) { - $c->log->warn( qq(Found results for "${name}" using regexp fallback.) ); $c->log->warn( 'Relying on the regexp fallback behavior for component resolution is unreliable and unsafe.' ); $c->log->warn( 'If you really want to search, pass in a regexp as the argument.' ); } @@ -531,7 +510,7 @@ Gets a L instance by name. Any extra arguments are directly passed to ACCEPT_CONTEXT. If the name is omitted, it will look for - - a model object in $c->stash->{current_model_instance}, then + - a model object in $c->stash{current_model_instance}, then - a model name in $c->stash->{current_model}, then - a config setting 'default_model', or - check if there is only one model, and return it if that's the case. @@ -584,7 +563,7 @@ Gets a L instance by name. Any extra arguments are directly passed to ACCEPT_CONTEXT. If the name is omitted, it will look for - - a view object in $c->stash->{current_view_instance}, then + - a view object in $c->stash{current_view_instance}, then - a view name in $c->stash->{current_view}, then - a config setting 'default_view', or - check if there is only one view, and return it if that's the case. @@ -683,13 +662,11 @@ sub component { if( !ref $name ) { # is it the exact name? - return $c->_filter_component( $comps->{ $name }, @args ) - if exists $comps->{ $name }; + return $comps->{ $name } if exists $comps->{ $name }; # perhaps we just omitted "MyApp"? my $composed = ( ref $c || $c ) . "::${name}"; - return $c->_filter_component( $comps->{ $composed }, @args ) - if exists $comps->{ $composed }; + return $comps->{ $composed } if exists $comps->{ $composed }; # search all of the models, views and controllers my( $comp ) = $c->_comp_search_prefixes( $name, qw/Model M Controller C View V/ ); @@ -700,13 +677,12 @@ sub component { my $query = ref $name ? $name : qr{$name}i; my @result = grep { m{$query} } keys %{ $c->components }; - return map { $c->_filter_component( $_, @args ) } @result if ref $name; + return @result if ref $name; if( $result[ 0 ] ) { - $c->log->warn( qq(Found results for "${name}" using regexp fallback.) ); $c->log->warn( 'Relying on the regexp fallback behavior for component resolution' ); $c->log->warn( 'is unreliable and unsafe. You have been warned' ); - return $c->_filter_component( $result[ 0 ], @args ); + return $result[ 0 ]; } # I would expect to return an empty list here, but that breaks back-compat @@ -1284,12 +1260,7 @@ sub execute { my $last = pop( @{ $c->stack } ); if ( my $error = $@ ) { - if ( !ref($error) and $error eq $DETACH ) { - die $DETACH if($c->depth > 1); - } - elsif ( !ref($error) and $error eq $GO ) { - die $GO if($c->depth > 0); - } + if ( !ref($error) and $error eq $DETACH ) { die $DETACH if $c->depth > 1 } else { unless ( ref $error ) { no warnings 'uninitialized'; @@ -1915,11 +1886,6 @@ search paths, specify a key named C as an array reference. Items in the array beginning with C<::> will have the application class name prepended to them. -All components found will also have any -L loaded and set up as components. -Note, that modules which are B an I of the main -file namespace loaded will not be instantiated as components. - =cut sub setup_components { @@ -2425,15 +2391,13 @@ Wiki: =head2 L - The test suite. -=head1 PROJECT FOUNDER - -sri: Sebastian Riedel +=head1 CREDITS -=head1 CONTRIBUTORS +Andy Grundman -abw: Andy Wardley +Andy Wardley -acme: Leon Brocard +Andreas Marienborg Andrew Bramble @@ -2441,67 +2405,65 @@ Andrew Ford Andrew Ruthven -andyg: Andy Grundman +Arthur Bergman -audreyt: Audrey Tang +Autrijus Tang -bricas: Brian Cassidy +Brian Cassidy -chansen: Christian Hansen +Carl Franks -chicks: Christopher Hicks +Christian Hansen -dkubb: Dan Kubb +Christopher Hicks -Drew Taylor +Dan Sully -esskar: Sascha Kiefer +Danijel Milicevic -fireartist: Carl Franks +David Kamholz -gabb: Danijel Milicevic +David Naughton + +Drew Taylor Gary Ashton Jones Geoff Richards -jcamacho: Juan Camacho +Jesse Sheidlower + +Jesse Vincent Jody Belka Johan Lindstrom -jon: Jon Schutz +Juan Camacho -marcus: Marcus Ramberg +Leon Brocard -miyagawa: Tatsuhiko Miyagawa +Marcus Ramberg -mst: Matt S. Trout +Matt S Trout -mugwump: Sam Vilain +Robert Sedlacek -naughton: David Naughton +Sam Vilain -ningu: David Kamholz +Sascha Kiefer -nothingmuch: Yuval Kogman +Sebastian Willert -numa: Dan Sully +Tatsuhiko Miyagawa -obra: Jesse Vincent - -omega: Andreas Marienborg - -phaylon: Robert Sedlacek - -sky: Arthur Bergman +Ulf Edvinsson -the_jester: Jesse Sheidlower +Yuval Kogman -Ulf Edvinsson +=head1 AUTHOR -willert: Sebastian Willert +Sebastian Riedel, C =head1 LICENSE