X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage.pm;h=a1c551e24b8757aacbb730815bf5b482b7833913;hb=70f3927877ba6b7aac2565bc1933daaf82361308;hp=336906997f9c007fd7b6ffcc47521b46d5995b89;hpb=6500d50ffcc63b544cf54f5ea1e43dbff9dd1151;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index 3369069..a1c551e 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -7,8 +7,14 @@ use base qw/DBIx::Class/; use Scalar::Util qw/weaken/; use Carp::Clan qw/^DBIx::Class/; +use IO::File; __PACKAGE__->mk_group_accessors('simple' => qw/debug debugobj schema/); +__PACKAGE__->mk_group_accessors('inherited' => 'cursor_class'); + +__PACKAGE__->cursor_class('DBIx::Class::Cursor'); + +sub cursor { shift->cursor_class(@_); } package # Hide from PAUSE DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION; @@ -55,19 +61,11 @@ sub new { $new->set_schema($schema); $new->debugobj(new DBIx::Class::Storage::Statistics()); - my $fh; + #my $fh; my $debug_env = $ENV{DBIX_CLASS_STORAGE_DBI_DEBUG} || $ENV{DBIC_TRACE}; - if (defined($debug_env) && ($debug_env =~ /=(.+)$/)) { - $fh = IO::File->new($1, 'w') - or $new->throw_exception("Cannot open trace file $1"); - } else { - $fh = IO::File->new('>&STDERR'); - } - - $new->debugfh($fh); $new->debug(1) if $debug_env; $new; @@ -322,14 +320,12 @@ sub debugcb { } } -=head2 cursor +=head2 cursor_class The cursor class for this Storage object. =cut -sub cursor { die "Virtual method!" } - =head2 deploy Deploy the tables to storage (CREATE TABLE and friends in a SQL-based