2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

configDB - code improvement

git-svn-id: https://svn.fhem.de/fhem/trunk@5576 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-04-19 23:04:46 +00:00
parent 9a753fa73d
commit 76e36b7f98

View File

@ -682,18 +682,18 @@ sub _cfgDB_Filelist {
return $ret; return $ret;
} }
sub _cfgDB_Readlayout($) { sub _cfgDB_Readfile($) {
my ($filename) = @_; my ($filename) = @_;
my $fhem_dbh = _cfgDB_Connect; my $fhem_dbh = _cfgDB_Connect;
my $sth = $fhem_dbh->prepare( "SELECT line FROM fhemfilesave WHERE filename = '$filename'" ); my $sth = $fhem_dbh->prepare( "SELECT line FROM fhemfilesave WHERE filename = '$filename'" );
$sth->execute(); $sth->execute();
my @layout; my @outfile;
while (my @line = $sth->fetchrow_array()) { while (my @line = $sth->fetchrow_array()) {
push @layout, "$line[0] "; push @outfile, "$line[0] ";
} }
$sth->finish(); $sth->finish();
$fhem_dbh->disconnect(); $fhem_dbh->disconnect();
return (int(@layout)) ? join("\n",@layout) : undef; return (int(@outfile)) ? join("\n",@outfile) : undef;
} }