summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Handle.pm
diff options
context:
space:
mode:
authorivan <ivan>2002-08-12 06:17:09 +0000
committerivan <ivan>2002-08-12 06:17:09 +0000
commit3ef62a0570055da710328937e7f65dbb2c027c62 (patch)
treed549158b172fd499b4f81a2981b62aabbde4f99b /rt/lib/RT/Handle.pm
parent030438c9cb1c12ccb79130979ef0922097b4311a (diff)
import rt 2.0.14
Diffstat (limited to 'rt/lib/RT/Handle.pm')
-rw-r--r--rt/lib/RT/Handle.pm53
1 files changed, 53 insertions, 0 deletions
diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm
new file mode 100644
index 0000000..6b74f36
--- /dev/null
+++ b/rt/lib/RT/Handle.pm
@@ -0,0 +1,53 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Handle.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+=head1 NAME
+
+ RT::Handle - RT's database handle
+
+=head1 SYNOPSIS
+
+ use RT::Handle;
+
+=head1 DESCRIPTION
+
+=begin testing
+
+ok(require RT::Handle);
+
+=end testing
+
+=head1 METHODS
+
+=cut
+
+package RT::Handle;
+
+eval "use DBIx::SearchBuilder::Handle::$RT::DatabaseType;
+
+\@ISA= qw(DBIx::SearchBuilder::Handle::$RT::DatabaseType);";
+
+#TODO check for errors here.
+
+=head2 Connect
+
+Takes nothing. Calls SUPER::Connect with the needed args
+
+=cut
+
+sub Connect {
+my $self=shift;
+
+# Unless the database port is a positive integer, we really don't want to pass it.
+$RT::DatabasePort = undef unless (defined $RT::DatabasePort && $RT::DatabasePort =~ /^(\d+)$/);
+
+$self->SUPER::Connect(Host => $RT::DatabaseHost,
+ Database => $RT::DatabaseName,
+ User => $RT::DatabaseUser,
+ Password => $RT::DatabasePassword,
+ Port => $RT::DatabasePort,
+ Driver => $RT::DatabaseType,
+ RequireSSL => $RT::DatabaseRequireSSL,
+ );
+
+}
+1;