Skip to content

Commit

Permalink
load $DBI_CLASS
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo committed Apr 7, 2011
1 parent 67c95d1 commit 243f186
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
Revision history for Perl extension Scope::Container::DBI

0.03 Thu Apr 7 18:09:41 2011
- fixed loading DBI_CLASS

0.02 Thu Apr 7 17:55:03 2011
- support DBI's subclass

Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -7,7 +7,7 @@ requires 'Log::Minimal';
requires 'List::Util';
requires 'Data::Dumper';
requires 'DBI';

requires 'Class::Load';

tests 't/*.t';
author_tests 'xt';
Expand Down
5 changes: 4 additions & 1 deletion lib/Scope/Container/DBI.pm
Expand Up @@ -6,10 +6,11 @@ use Scope::Container;
use Log::Minimal;
use List::Util qw/shuffle/;
use Data::Dumper;
use Class::Load qw/load_class/;
use Carp;
use DBI;

our $VERSION = '0.02';
our $VERSION = '0.03';
our $DBI_CLASS = 'DBI';

sub connect {
Expand Down Expand Up @@ -47,6 +48,8 @@ sub connect {
my ($dsn, $user, $pass, $attr) = @dsn;
$attr->{AutoInactiveDestroy} = 1;

load_class $DBI_CLASS;

my $dbh = do {
if ($INC{'Apache/DBI.pm'} && $ENV{MOD_PERL}) {
local $DBI::connect_via = 'connect'; # Disable Apache::DBI.
Expand Down

0 comments on commit 243f186

Please sign in to comment.