From bb131dc3325ae802000fab65551ea293692ab800 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sat, 3 May 2014 12:00:31 +0000 Subject: [PATCH] configDB - code cleanup git-svn-id: https://svn.fhem.de/fhem/trunk@5732 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/configDB.pm | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/fhem/configDB.pm b/fhem/configDB.pm index cf471d768..67d9be099 100644 --- a/fhem/configDB.pm +++ b/fhem/configDB.pm @@ -159,6 +159,7 @@ if($cfgDB_dbconn =~ m/pg:/i) { my $count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemconfig'); if($count < 1) { # insert default entries to get fhem running + $fhem_dbh->commit(); my $uuid = _cfgDB_Uuid; $fhem_dbh->do("INSERT INTO fhemversions values (0, '$uuid')"); _cfgDB_InsertLine($fhem_dbh, $uuid, '#created by cfgDB_Init'); @@ -912,37 +913,6 @@ sub _cfgDB_Filelist(;$) { # ####################################### - -# replaced by cfgDB_AttrRead() -sub cfgDB_GlobalAttr { - my (@line, $row); - - my $fhem_dbh = _cfgDB_Connect; - my $uuid = $fhem_dbh->selectrow_array('SELECT versionuuid FROM fhemversions WHERE version = 0'); - my $sth = $fhem_dbh->prepare( "SELECT * FROM fhemconfig WHERE DEVICE = ( ? ) and VERSIONUUID = '$uuid'" ); - - $sth->execute('global'); - while (@line = $sth->fetchrow_array()) { - $row = "$line[0] $line[1] $line[2] $line[3]"; - $line[3] =~ s/#.*//; - $line[3] =~ s/ .*$//; - $attr{global}{$line[2]} = $line[3]; - GlobalAttr("set", "global", $line[2], $line[3]); - } - - $sth->execute('configdb'); - while (@line = $sth->fetchrow_array()) { - $row = "$line[0] $line[1] $line[2] $line[3]"; - $line[3] =~ s/#.*//; - $line[3] =~ s/ .*$//; - $attr{configdb}{$line[2]} = $line[3]; - GlobalAttr("set", "global", $line[2], $line[3]); - } - - $fhem_dbh->disconnect(); - return; -} - # deprecated - replaced by cfgDB_FileRead() sub _cfgDB_Readfile($) { my ($filename) = @_;