X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=ddc91738eea88a72730213f8d01647c6d750bba6;hb=4dca6c081be62b6542fda0a8098e8787dd5bcae2;hp=41b54ebe285dc5de68760f902c3ce94b366e436c;hpb=878b821cd4548d9d3f5a6c5aa05fb2f0c29fe3b0;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 41b54eb..ddc9173 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -63,7 +63,7 @@ __PACKAGE__->response_class('Catalyst::Response'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.7008'; +our $VERSION = '5.7011'; sub import { my ( $class, @arguments ) = @_; @@ -1865,6 +1865,7 @@ sub setup_components { my $locator = Module::Pluggable::Object->new( search_path => [ map { s/^(?=::)/$class/; $_; } @paths ], + except => qr/\.#/, %$config ); @@ -1872,6 +1873,11 @@ sub setup_components { my %comps = map { $_ => 1 } @comps; for my $component ( @comps ) { + + # We pass ignore_loaded here so that overlay files for (e.g.) + # Model::DBI::Schema sub-classes are loaded - if it's in @comps + # we know M::P::O found a file on disk so this is safe + Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } ); my $module = $class->setup_component( $component ); @@ -2149,7 +2155,10 @@ the plugin name does not begin with C. my ( $proto, $plugin, $instant ) = @_; my $class = ref $proto || $proto; - Catalyst::Utils::ensure_class_loaded( $plugin, { ignore_loaded => 1 } ); + # no ignore_loaded here, the plugin may already have been + # defined in memory and we don't want to error on "no file" if so + + Catalyst::Utils::ensure_class_loaded( $plugin ); $proto->_plugins->{$plugin} = 1; unless ($instant) {