X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat.pm;h=f3697c217b2556f264f916af0a9340759a359a0e;hb=95b76469a363174145245b3490ebba83d1b639ce;hp=ee983fd7eea24b6c85cd61e2deb2bfe0b0026f05;hpb=0c11ad0ee5c8407f6b87d6e15c62a1b445076dc0;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat.pm b/lib/DBIx/Class/CDBICompat.pm index ee983fd..f3697c2 100644 --- a/lib/DBIx/Class/CDBICompat.pm +++ b/lib/DBIx/Class/CDBICompat.pm @@ -2,22 +2,15 @@ package DBIx::Class::CDBICompat; use strict; use warnings; -use base qw/DBIx::Class::Core DBIx::Class::DB/; - -# Modules CDBICompat needs that DBIx::Class does not. -my @Extra_Modules = qw( - Class::Trigger - DBIx::ContextualFetch - Clone -); -my @didnt_load; -for my $module (@Extra_Modules) { - push @didnt_load, $module unless eval qq{require $module}; +BEGIN { + require DBIx::Class::Optional::Dependencies; + if (my $missing = DBIx::Class::Optional::Dependencies->req_missing_for('cdbicompat')) { + die "The following extra modules are required for DBIx::Class::CDBICompat: $missing\n"; + } } -__PACKAGE__->throw_exception("@{[ join ', ', @didnt_load ]} are missing and are required for CDBICompat") - if @didnt_load; +use base qw/DBIx::Class::Core DBIx::Class::DB/; __PACKAGE__->load_own_components(qw/ Constraints @@ -45,9 +38,10 @@ __PACKAGE__->load_own_components(qw/ Iterator /); - #DBIx::Class::ObjIndexStubs 1; +__END__ + =head1 NAME DBIx::Class::CDBICompat - Class::DBI Compatibility layer. @@ -165,13 +159,13 @@ Relationships between tables (has_a, has_many...) must be declared after all tab =back -=head1 AUTHOR AND CONTRIBUTORS - -See L and L in DBIx::Class - -=head1 LICENSE +=head1 FURTHER QUESTIONS? -You may distribute this code under the same terms as Perl itself. +Check the list of L. -=cut +=head1 COPYRIGHT AND LICENSE +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L.