Revision f964437c
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
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
Form::_dbconnect_options nach SL::DBConnect::get_options verschoben