Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f964437c

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID f964437c368c7ebf2a11e61648ccc66d5a2743d8
  • Vorgänger b8f9149b
  • Nachfolger 7edc2444

Form::_dbconnect_options nach SL::DBConnect::get_options verschoben

Unterschiede anzeigen:

SL/DBConnect.pm
20 20
  return DBIx::Log4perl->connect(@_);
21 21
}
22 22

  
23
sub get_options {
24
  my $self    = shift;
25
  my $options = {
26
    pg_enable_utf8 => $::locale->is_utf8,
27
    @_
28
  };
29

  
30
  return $options;
31
}
32

  
23 33
1;
SL/Form.pm
1361 1361

  
1362 1362
# Database routines used throughout
1363 1363

  
1364
sub _dbconnect_options {
1365
  my $self    = shift;
1366
  my $options = { pg_enable_utf8 => $::locale->is_utf8,
1367
                  @_ };
1368

  
1369
  return $options;
1370
}
1371

  
1372 1364
sub dbconnect {
1373 1365
  $main::lxdebug->enter_sub(2);
1374 1366

  
1375 1367
  my ($self, $myconfig) = @_;
1376 1368

  
1377 1369
  # connect to database
1378
  my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options)
1370
  my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, SL::DBConnect->get_options)
1379 1371
    or $self->dberror;
1380 1372

  
1381 1373
  # set db options
......
1394 1386
  my ($self, $myconfig) = @_;
1395 1387

  
1396 1388
  # connect to database
1397
  my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0))
1389
  my $dbh = SL::DBConnect->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, SL::DBConnect->get_options(AutoCommit => 0))
1398 1390
    or $self->dberror;
1399 1391

  
1400 1392
  # set db options

Auch abrufbar als: Unified diff