From: Peter Rabbitson Date: Mon, 29 Jun 2009 23:13:49 +0000 (+0000) Subject: Make sure storage classes use c3, just like the rest of dbic (tested on 5.8 as well) X-Git-Tag: v0.08108~12^2~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=329d7385956628f5c4371fa0da86cef01852f135;p=dbsrgits%2FDBIx-Class.git Make sure storage classes use c3, just like the rest of dbic (tested on 5.8 as well) --- diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index bed13d2..677ddb7 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -3,11 +3,12 @@ package DBIx::Class; use strict; use warnings; +use MRO::Compat; + use vars qw($VERSION); use base qw/DBIx::Class::Componentised Class::Accessor::Grouped/; use DBIx::Class::StartupCheck; - sub mk_classdata { shift->mk_classaccessor(@_); } diff --git a/lib/DBIx/Class/SQLAHacks.pm b/lib/DBIx/Class/SQLAHacks.pm index 7ff05d6..00345c4 100644 --- a/lib/DBIx/Class/SQLAHacks.pm +++ b/lib/DBIx/Class/SQLAHacks.pm @@ -12,12 +12,13 @@ BEGIN { no warnings qw/redefine/; no strict qw/refs/; for my $f (qw/carp croak/) { + my $orig = \&{"SQL::Abstract::$f"}; *{"SQL::Abstract::$f"} = sub { local $Carp::CarpLevel = 1; # even though Carp::Clan ignores this, $orig will not - if (Carp::longmess() =~ /DBIx::Class::SQLAHacks::[\w]+\(\) called/) { + if (Carp::longmess() =~ /DBIx::Class::SQLAHacks::[\w]+ .+? called \s at/x) { __PACKAGE__->can($f)->(@_); } else { diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 80c43d9..bf2d76e 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -7,9 +7,8 @@ use DBIx::Class::Exception; use Carp::Clan qw/^DBIx::Class/; use Scalar::Util qw/weaken/; use File::Spec; -use MRO::Compat; use Sub::Name (); -require Module::Find; +use Module::Find(); use base qw/DBIx::Class/; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 56dd7e2..236c33d 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -642,8 +642,10 @@ sub _determine_driver { ($driver) = $self->_dbi_connect_info->[0] =~ /dbi:([^:]+):/i; } - if ($self->load_optional_class("DBIx::Class::Storage::DBI::${driver}")) { - bless $self, "DBIx::Class::Storage::DBI::${driver}"; + my $storage_class = "DBIx::Class::Storage::DBI::${driver}"; + if ($self->load_optional_class($storage_class)) { + mro::set_mro($storage_class, 'c3'); + bless $self, $storage_class; $self->_rebless(); } }