X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=2a40bc56236709d1c7e8febdd2943c2a7d86739f;hp=aa7b2e6115ece5d120020604e549fbe0b7c327f9;hb=1b526dcc8437ccd8c55e8e313f3fe247b6741969;hpb=b11b634514ba61907a4883935f1c83de0926acbd diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index aa7b2e6..2a40bc5 100755 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -126,7 +126,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90063'; +our $VERSION = '5.90069_001'; sub import { my ( $class, @arguments ) = @_; @@ -1252,9 +1252,10 @@ EOF } $class->setup_finalize; - # Should be the last thing we do so that user things hooking - # setup_finalize can log.. + + # Flush the log for good measure (in case something turned off 'autoflush' early) $class->log->_flush() if $class->log->can('_flush'); + return $class || 1; # Just in case someone named their Application 0... } @@ -2593,18 +2594,15 @@ sub locate_components { my $class = shift; my $config = shift; - my @paths = qw( ::Controller ::C ::Model ::M ::View ::V ); + my @paths = qw( ::M ::Model ::V ::View ::C ::Controller ); my $extra = delete $config->{ search_extra } || []; - push @paths, @$extra; + unshift @paths, @$extra; - my $locator = Module::Pluggable::Object->new( - search_path => [ map { s/^(?=::)/$class/; $_; } @paths ], - %$config - ); - - # XXX think about ditching this sort entirely - my @comps = sort { length $a <=> length $b } $locator->plugins; + my @comps = map { sort { length($a) <=> length($b) } Module::Pluggable::Object->new( + search_path => [ map { s/^(?=::)/$class/; $_; } ($_) ], + %$config + )->plugins } @paths; return @comps; } @@ -3587,7 +3585,7 @@ example given above, which uses L to provide either L it installed (if you want the faster XS parser, add it to you project Makefile.PL or dist.ini, cpanfile, etc.) -The C configuation is a hashref whose keys are HTTP Content-Types +The C configuration is a hashref whose keys are HTTP Content-Types (matched against the incoming request type using a regexp such as to be case insensitive) and whose values are coderefs that receive a localized version of C<$_> which is a filehandle object pointing to received body. @@ -3952,6 +3950,8 @@ t0m: Tomas Doran Ulf Edvinsson +vanstyn: Henry Van Styn + Viljo Marrandi C Will Hawes C