From: Matt S Trout Date: Sat, 28 Jan 2006 15:29:48 +0000 (+0000) Subject: Booted UNIVERSAL::require sideways out the codebase X-Git-Tag: v0.05005~85 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ef144fff4b1efed17257ac84c9e455adbd2fcbe;p=dbsrgits%2FDBIx-Class.git Booted UNIVERSAL::require sideways out the codebase --- diff --git a/Build.PL b/Build.PL index db515d4..3b06ba2 100644 --- a/Build.PL +++ b/Build.PL @@ -8,7 +8,6 @@ my %arguments = ( requires => { 'Data::Page' => 2.00, 'DBI' => 1.40, - 'UNIVERSAL::require' => 0, 'Scalar::Util' => 0, 'SQL::Abstract' => 1.20, 'SQL::Abstract::Limit' => 0.101, @@ -18,7 +17,6 @@ my %arguments = ( 'Module::Find' => 0, 'Storable' => 0, 'Class::Data::Accessor' => 0.01, - # Following for CDBICompat only 'Carp::Clan' => 0, }, recommends => { diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index cc6c949..c84e0a7 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -4,7 +4,6 @@ use strict; use warnings; use Carp::Clan qw/^DBIx::Class/; -use UNIVERSAL::require; use base qw/DBIx::Class/; @@ -230,7 +229,9 @@ you expect. sub compose_connection { my ($self, $target, @info) = @_; my $base = 'DBIx::Class::ResultSetProxy'; - $base->require; + eval "require ${base};"; + $self->throw_exception("No arguments to load_classes and couldn't load". + " ${base} ($@)") if $@; if ($self eq $target) { # Pathological case, largely caused by the docs on early C::M::DBIC::Plain @@ -311,7 +312,9 @@ sub connection { my $storage_class = $self->storage_type; $storage_class = 'DBIx::Class::Storage'.$storage_class if $storage_class =~ m/^::/; - $storage_class->require; + eval "require ${storage_class};"; + $self->throw_exception("No arguments to load_classes and couldn't load". + " ${storage_class} ($@)") if $@; my $storage = $storage_class->new; $storage->connect_info(\@info); $self->storage($storage);