Form::_dbconnect_options nach SL::DBConnect::get_options verschoben
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 22 May 2013 13:33:36 +0000 (15:33 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 22 May 2013 14:15:01 +0000 (16:15 +0200)
SL/DBConnect.pm
SL/Form.pm

index 4e08450..8dc9787 100644 (file)
@@ -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;
index 7b5d257..018526a 100644 (file)
@@ -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