Prepare for git repository
[spider.git] / perl / DXSql.pm
index a2194a7b2f7618a06f0ba10a1b1064f69f22e0d5..1a4fee810718c8c1ddcba4506007482f04638035 100644 (file)
@@ -10,18 +10,17 @@ package DXSql;
 
 use strict;
 
+use DXSql::SQLite;
+use DXSql::mysql;
 use DXDebug;
 
-use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
-
-our $active = 0;
+use vars qw($active);
+$active = 0;
 
 sub init
 {
+       my $dsn = shift;
+       return unless $dsn;
        return $active if $active;
        
        eval { 
@@ -31,6 +30,7 @@ sub init
                import DBI;
                $active++;
        }
+       undef $@;
        return $active;
 }