mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
configDB.pm: fix filelist problem on perl >= 5.20
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@11084 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b88d290278
commit
8356a43251
16
configDB.pm
16
configDB.pm
@ -110,6 +110,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Text::Diff;
|
use Text::Diff;
|
||||||
use DBI;
|
use DBI;
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
# Forward declarations for functions in fhem.pl
|
# Forward declarations for functions in fhem.pl
|
||||||
@ -1035,23 +1036,18 @@ sub _cfgDB_binFileimport($$;$) {
|
|||||||
sub _cfgDB_Filelist(;$) {
|
sub _cfgDB_Filelist(;$) {
|
||||||
my ($notitle) = @_;
|
my ($notitle) = @_;
|
||||||
my $ret = "Files found in database:\n".
|
my $ret = "Files found in database:\n".
|
||||||
"------------------------------------------------------------\n";
|
"------------------------------------------------------------\n";
|
||||||
$ret = "" if $notitle;
|
$ret = "" if $notitle;
|
||||||
my $fhem_dbh = _cfgDB_Connect;
|
my $fhem_dbh = _cfgDB_Connect;
|
||||||
my @dbtable = ('fhembinfilesave');
|
my $sql = "SELECT filename FROM fhembinfilesave group by filename order by filename";
|
||||||
foreach (@dbtable) {
|
my $content = $fhem_dbh->selectall_arrayref($sql);
|
||||||
my $sth = $fhem_dbh->prepare( "SELECT filename FROM $_ group by filename order by filename" );
|
foreach my $row (@$content) {
|
||||||
$sth->execute();
|
$ret .= "@$row[0]\n" if(defined(@$row[0]));
|
||||||
while (my $line = $sth->fetchrow_array()) {
|
|
||||||
$ret .= "$line\n";
|
|
||||||
}
|
|
||||||
$sth->finish();
|
|
||||||
}
|
}
|
||||||
$fhem_dbh->disconnect();
|
$fhem_dbh->disconnect();
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user