2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

configDB - code cleanup

git-svn-id: https://svn.fhem.de/fhem/trunk@5909 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-05-20 11:10:05 +00:00
parent bdf075749a
commit e0582b9439

View File

@ -262,7 +262,7 @@ sub cfgDB_AttrRead($) {
# generic file functions called from fhem.pl # generic file functions called from fhem.pl
sub cfgDB_FileRead($) { sub cfgDB_FileRead($) {
my ($filename) = @_; my ($filename) = @_;
my ($err, @ret, $counter); my ($err, @ret, $counter);
my $fhem_dbh = _cfgDB_Connect; my $fhem_dbh = _cfgDB_Connect;
my $sth = $fhem_dbh->prepare( "SELECT content FROM fhembinfilesave WHERE filename LIKE '$filename'" ); my $sth = $fhem_dbh->prepare( "SELECT content FROM fhembinfilesave WHERE filename LIKE '$filename'" );
$sth->execute(); $sth->execute();
@ -628,9 +628,13 @@ sub _cfgDB_Info() {
my ($sql, $sth, @line, $row); my ($sql, $sth, @line, $row);
# read versions table statistics # read versions table statistics
my $maxVersions = $attr{configdb}{maxversions};
$maxVersions = ($maxVersions) ? $maxVersions : 0;
push @r, " max Versions: $maxVersions" if($maxVersions);
my $count; my $count;
$count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemconfig'); $count = $fhem_dbh->selectrow_array('SELECT count(*) FROM fhemconfig');
push @r, " config: $count entries\n"; push @r, " config: $count entries";
push @r, "";
# read versions creation time # read versions creation time
$sql = "SELECT * FROM fhemconfig as c join fhemversions as v on v.versionuuid=c.versionuuid ". $sql = "SELECT * FROM fhemconfig as c join fhemversions as v on v.versionuuid=c.versionuuid ".
@ -659,9 +663,6 @@ sub _cfgDB_Info() {
} }
push @r, $l; push @r, $l;
# count files stored in database
# $row = $fhem_dbh->selectall_arrayref("SELECT filename from fhemfilesave group by filename");
# $count = @$row;
$row = $fhem_dbh->selectall_arrayref("SELECT filename from fhembinfilesave group by filename"); $row = $fhem_dbh->selectall_arrayref("SELECT filename from fhembinfilesave group by filename");
$count = @$row; $count = @$row;
$count = ($count)?$count:'No'; $count = ($count)?$count:'No';