summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Handle.pm
blob: 6b74f361b0246615ee4c491966dc502b7909301c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;