From f964437c368c7ebf2a11e61648ccc66d5a2743d8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 22 May 2013 15:33:36 +0200 Subject: [PATCH] Form::_dbconnect_options nach SL::DBConnect::get_options verschoben --- SL/DBConnect.pm | 10 ++++++++++ SL/Form.pm | 12 ++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/SL/DBConnect.pm b/SL/DBConnect.pm index 4e084502a..8dc978758 100644 --- a/SL/DBConnect.pm +++ b/SL/DBConnect.pm @@ -20,4 +20,14 @@ sub connect { return DBIx::Log4perl->connect(@_); } +sub get_options { + my $self = shift; + my $options = { + pg_enable_utf8 => $::locale->is_utf8, + @_ + }; + + return $options; +} + 1; diff --git a/SL/Form.pm b/SL/Form.pm index 7b5d257b8..018526ac6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1361,21 +1361,13 @@ sub datetonum { # Database routines used throughout -sub _dbconnect_options { - my $self = shift; - my $options = { pg_enable_utf8 => $::locale->is_utf8, - @_ }; - - return $options; -} - sub dbconnect { $main::lxdebug->enter_sub(2); my ($self, $myconfig) = @_; # connect to database - my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options) + my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, SL::DBConnect->get_options) or $self->dberror; # set db options @@ -1394,7 +1386,7 @@ sub dbconnect_noauto { my ($self, $myconfig) = @_; # connect to database - my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0)) + my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, SL::DBConnect->get_options(AutoCommit => 0)) or $self->dberror; # set db options -- 2.20.1