X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=2550cb58e458bd1f045e824f55b7679bf7713328;hb=fd8076c89806c4e6222b032e5cc8f5b45e02c6e8;hp=d36bcf149ea1fa5729937080679f69c6489380f5;hpb=93963f599878e7c2808c58083d214da5270a2691;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index d36bcf1..2550cb5 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -6,10 +6,10 @@ use warnings; use DBIx::Class::Exception; use DBIx::Class::Carp; use Try::Tiny; -use Scalar::Util 'weaken'; +use Scalar::Util qw/weaken blessed/; use Sub::Name 'subname'; use B 'svref_2object'; -use DBIx::Class::GlobalDestruction; +use Devel::GlobalDestruction; use namespace::clean; use base qw/DBIx::Class/; @@ -168,12 +168,9 @@ sub _findallmod { my $ns = shift || ref $proto || $proto; require Module::Find; - my @mods = Module::Find::findallmod($ns); - # try to untaint module names. mods where this fails - # are left alone so we don't have to change the old behavior - no locale; # localized \w doesn't untaint expression - return map { $_ =~ m/^( (?:\w+::)* \w+ )$/x ? $1 : $_ } @mods; + # untaint result + return map { $_ =~ /(.+)/ } Module::Find::findallmod($ns); } # returns a hash of $shortname => $fullname for every package @@ -1222,12 +1219,12 @@ sub ddl_filename { require File::Spec; - my $filename = ref($self); - $filename =~ s/::/-/g; - $filename = File::Spec->catfile($dir, "$filename-$version-$type.sql"); - $filename =~ s/$version/$preversion-$version/ if($preversion); + $version = "$preversion-$version" if $preversion; - return $filename; + my $class = blessed($self) || $self; + $class =~ s/::/-/g; + + return File::Spec->catfile($dir, "$class-$version-$type.sql"); } =head2 thaw