use strict;
use warnings;
-use base qw/DBIx::Class::Core DBIx::Class::DB/;
-use Carp::Clan qw/^DBIx::Class/;
-
-# 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";
+ }
}
-croak("@{[ 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
Iterator
/);
- #DBIx::Class::ObjIndexStubs
1;
+__END__
+
=head1 NAME
DBIx::Class::CDBICompat - Class::DBI Compatibility layer.
=head1 DESCRIPTION
DBIx::Class features a fully featured compatibility layer with L<Class::DBI>
-and some common plugins to ease transition for existing CDBI users.
+and some common plugins to ease transition for existing CDBI users.
This is not a wrapper or subclass of DBIx::Class but rather a series of plugins. The result being that even though you're using the Class::DBI emulation layer you are still getting DBIx::Class objects. You can use all DBIx::Class features and methods via CDBICompat. This allows you to take advantage of DBIx::Class features without having to rewrite your CDBI code.
=head2 Choosing Features
In fact, this class is just a recipe containing all the features emulated.
-If you like, you can choose which features to emulate by building your
+If you like, you can choose which features to emulate by building your
own class and loading it like this:
package My::DB;
=back
-=head1 AUTHORS
-
-Matt S. Trout <mst@shadowcatsystems.co.uk>
-
-=head1 LICENSE
+=head1 FURTHER QUESTIONS?
-You may distribute this code under the same terms as Perl itself.
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
-=cut
+=head1 COPYRIGHT AND LICENSE
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.