summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Handle.pm
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:11:20 +0000
committerivan <ivan>2005-10-15 09:11:20 +0000
commitd4d0590bef31071e8809ec046717444b95b3f30a (patch)
treeee1236da50578390d2642114f28eaed99a5efb18 /rt/lib/RT/Handle.pm
parentd39d52aac8f38ea9115628039f0df5aa3ac826de (diff)
import rt 3.4.4
Diffstat (limited to 'rt/lib/RT/Handle.pm')
-rw-r--r--rt/lib/RT/Handle.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm
index 8d4563b66..21ca1ace6 100644
--- a/rt/lib/RT/Handle.pm
+++ b/rt/lib/RT/Handle.pm
@@ -1,8 +1,8 @@
-# {{{ BEGIN BPS TAGGED BLOCK
+# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
# <jesse@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,8 @@
# works based on those contributions, and sublicense and distribute
# those contributions and any derivatives thereof.
#
-# }}} END BPS TAGGED BLOCK
+# END BPS TAGGED BLOCK }}}
+
=head1 NAME
RT::Handle - RT's database handle
@@ -89,7 +90,9 @@ sub Connect {
my $self = shift;
if ($RT::DatabaseType eq 'Oracle') {
- $ENV{'NLS_LANG'} = ".UTF8";
+ $ENV{'NLS_LANG'} = "AMERICAN_AMERICA.AL32UTF8";
+ $ENV{'NLS_NCHAR'} = "AL32UTF8";
+
}
$self->SUPER::Connect(
@@ -101,19 +104,23 @@ sub Connect {
}
-=item BuildDSN
+=head2 BuildDSN
Build the DSN for the RT database. doesn't take any parameters, draws all that
from the config file.
=cut
+use File::Spec;
sub BuildDSN {
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+)$/);
$RT::DatabaseHost = undef unless (defined $RT::DatabaseHost && $RT::DatabaseHost ne '');
+$RT::DatabaseName = File::Spec->catfile($RT::VarPath, $RT::DatabaseName)
+ if ($RT::DatabaseType eq 'SQLite') and
+ not File::Spec->file_name_is_absolute($RT::DatabaseName);
$self->SUPER::BuildDSN(Host => $RT::DatabaseHost,