croak "ensure_class_loaded should be given a classname, not a filename ($class)"
if $class =~ m/\.pm$/;
+ # $opts->{ignore_loaded} can be set to true, and this causes the class to be required, even
+ # if it already has symbol table entries. This is to support things like Schema::Loader, which
+ # part-generate classes in memory, but then also load some of their contents from disk.
return if !$opts->{ ignore_loaded }
&& Class::MOP::is_class_loaded($class); # if a symbol entry exists we don't load again
- # as soon as Class::MOP 0.67 + 1 is released Class::MOP::load_class($class) can be used instead
+ # FIXME - as soon as Class::MOP 0.67 + 1 is released Class::MOP::load_class($class) can be used instead
# this hack is so we don't overwrite $@ if the load did not generate an error
my $error;
die $error if $error;
- die "require $class was successful but the package is not defined"
+ warn "require $class was successful but the package is not defined."
unless Class::MOP::is_class_loaded($class);
return 1;