- Moved Manual.pod to Manual.pm and clarified status of
Catalyst-Manual dist
- Doc patches to Catalyst::Controller
+ - remove ignore_loaded from plugin load, commenting why
+ - document the ignore_loaded feature in Catalyst::Utils
5.7008 2007-08-13 08:40:00
- Added $c->request->query_keywords for getting the keywords
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 );
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) {
return $request;
}
-=head2 ensure_class_loaded($class_name)
+=head2 ensure_class_loaded($class_name, \%opts)
Loads the class unless it already has been loaded.
+If $opts{ignore_loaded} is true always tries the require whether the package
+already exists or not. Only pass this if you're either (a) sure you know the
+file exists on disk or (b) have code to catch the file not found exception
+that will result if it doesn't.
+
=cut
sub ensure_class_loaded {