From: Peter Rabbitson Date: Sat, 13 Jul 2013 01:50:52 +0000 (+0200) Subject: Self-cleaning is not yet entirely stable - back it out for the time being X-Git-Tag: v0.08260~202 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=64c50e81078cbe18780c68b0397d34e49c30cd1e Self-cleaning is not yet entirely stable - back it out for the time being As a side-effect resolves RT#86267 --- diff --git a/lib/DBIx/Class/Carp.pm b/lib/DBIx/Class/Carp.pm index 4d2812c..69eab47 100644 --- a/lib/DBIx/Class/Carp.pm +++ b/lib/DBIx/Class/Carp.pm @@ -4,17 +4,6 @@ package # hide from pause use strict; use warnings; -# This is here instead of DBIx::Class because of load-order issues -BEGIN { - # something is tripping up V::M on 5.8.1, leading to segfaults. - # A similar test in n::c itself is disabled on 5.8.1 for the same - # reason. There isn't much motivation to try to find why it happens - *DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN = ($] < 5.008005) - ? sub () { 1 } - : sub () { 0 } - ; -} - # load Carp early to prevent tickling of the ::Internal stash being # interpreted as "Carp is already loaded" by some braindead loader use Carp (); @@ -130,13 +119,6 @@ sub import { $msg, ); }; - - # cleanup after ourselves - namespace::clean->import(-cleanee => $into, qw/carp carp_once carp_unique/) - ## FIXME FIXME FIXME - something is tripping up V::M on 5.8.1, leading - # to segfaults. When n::c/B::H::EndOfScope is rewritten in terms of tie() - # see if this starts working - unless DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN; } sub unimport { diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index be0d668..0fb91ad 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -8,6 +8,7 @@ use base 'Class::C3::Componentised'; use mro 'c3'; use DBIx::Class::Carp '^DBIx::Class|^Class::C3::Componentised'; +use namespace::clean; # this warns of subtle bugs introduced by UTF8Columns hacky handling of store_column # if and only if it is placed before something overriding store_column diff --git a/lib/DBIx/Class/Relationship/CascadeActions.pm b/lib/DBIx/Class/Relationship/CascadeActions.pm index 6b5b403..bcd3800 100644 --- a/lib/DBIx/Class/Relationship/CascadeActions.pm +++ b/lib/DBIx/Class/Relationship/CascadeActions.pm @@ -4,6 +4,7 @@ package # hide from PAUSE use strict; use warnings; use DBIx::Class::Carp; +use namespace::clean; our %_pod_inherit_config = ( diff --git a/lib/DBIx/Class/ResultSetColumn.pm b/lib/DBIx/Class/ResultSetColumn.pm index 3705d50..ed29a44 100644 --- a/lib/DBIx/Class/ResultSetColumn.pm +++ b/lib/DBIx/Class/ResultSetColumn.pm @@ -5,6 +5,7 @@ use warnings; use base 'DBIx::Class'; use DBIx::Class::Carp; +use namespace::clean; # not importing first() as it will clash with our own method use List::Util (); diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 2232b39..f2e27c8 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -3,6 +3,8 @@ package DBIx::Class::Schema; use strict; use warnings; +use base 'DBIx::Class'; + use DBIx::Class::Carp; use Try::Tiny; use Scalar::Util qw/weaken blessed/; @@ -11,8 +13,6 @@ use B 'svref_2object'; use Devel::GlobalDestruction; use namespace::clean; -use base qw/DBIx::Class/; - __PACKAGE__->mk_classdata('class_mappings' => {}); __PACKAGE__->mk_classdata('source_registrations' => {}); __PACKAGE__->mk_classdata('storage_type' => '::DBI'); diff --git a/lib/DBIx/Class/Serialize/Storable.pm b/lib/DBIx/Class/Serialize/Storable.pm index 3d6d539..2a295d3 100644 --- a/lib/DBIx/Class/Serialize/Storable.pm +++ b/lib/DBIx/Class/Serialize/Storable.pm @@ -4,6 +4,7 @@ use warnings; use Storable(); use DBIx::Class::Carp; +use namespace::clean; carp 'The Serialize::Storable component is now *DEPRECATED*. It has not ' .'been providing any useful functionality for quite a while, and in fact ' diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm index aeb6aab..bb3da24 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm @@ -4,6 +4,7 @@ use strict; use warnings; use DBIx::Class::Carp; +use namespace::clean; carp 'Setting of storage_type is redundant as connections through DBD::Sybase' .' are now properly recognized and reblessed into the appropriate subclass' diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm index b3f048c..12dfa5b 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm @@ -10,6 +10,7 @@ use base qw/ use mro 'c3'; use DBIx::Class::Carp; +use namespace::clean; =head1 NAME diff --git a/t/55namespaces_cleaned.t b/t/55namespaces_cleaned.t index 5b147d4..254fdd7 100644 --- a/t/55namespaces_cleaned.t +++ b/t/55namespaces_cleaned.t @@ -113,8 +113,6 @@ for my $mod (@modules) { for my $name (keys %all_method_like) { - next if ( DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN and $name =~ /^carp(?:_unique|_once)?$/ ); - # overload is a funky thing - it is not cleaned, and its imports are named funny next if $name =~ /^\(/; @@ -151,8 +149,6 @@ for my $mod (@modules) { } } - next if DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN; - # some common import names (these should never ever be methods) for my $f (qw/carp carp_once carp_unique croak confess cluck try catch finally/) { if ($mod->can($f)) {