From b0722a819aa1019ad6bc82ef2e09984c347df56e Mon Sep 17 00:00:00 2001 From: betateilchen Date: Tue, 13 Jan 2015 11:37:50 +0000 Subject: [PATCH] configDB.pm: use createUniqueId() do not show 99_Utils.pm in "Edit files" git-svn-id: https://svn.fhem.de/fhem/trunk@7543 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/configDB.pm | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 18f25a1d2..aed272a51 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - changed: configDB.pm use fhem function createUniqueId() + configDB.pm do not show 99_Utils.pm in „Edit files“ - fix: CUL_MAX: fix usage of advanced culfw features on non-CUL devices - changed: 09_CUL_FHTTK: small update to the documentation in order to simulate the same diff --git a/fhem/configDB.pm b/fhem/configDB.pm index a69d40ee7..5e899ecb6 100644 --- a/fhem/configDB.pm +++ b/fhem/configDB.pm @@ -100,6 +100,7 @@ use DBI; # sub AnalyzeCommandChain($$;$); sub Log3($$$); +sub createUniqueId(); ################################################## # Forward declarations inside this library @@ -548,7 +549,7 @@ sub cfgDB_FW_fileList($$@) { next if( $f !~ m/^$dir/ ); $f =~ s,$dir\/,,; next if($f !~ m,^$re$,); - push @ret, "$f.configDB"; + push @ret, "$f.configDB" unless $f eq '99_Utils.pm'; } return @ret; } @@ -666,14 +667,19 @@ sub _cfgDB_Rotate($) { } # return a UUID based on DB-model +#sub _cfgDB_Uuid() { +# my $fhem_dbh = _cfgDB_Connect; +# my $uuid; +# $uuid = $fhem_dbh->selectrow_array('select lower(hex(randomblob(16)))') if($cfgDB_dbtype eq 'SQLITE'); +# $uuid = $fhem_dbh->selectrow_array('select uuid()') if($cfgDB_dbtype eq 'MYSQL'); +# $uuid = $fhem_dbh->selectrow_array('select uuid_generate_v4()') if($cfgDB_dbtype eq 'POSTGRESQL'); +# $fhem_dbh->disconnect(); +# return $uuid; +#} + +# 2015-01-12 use the fhem default function sub _cfgDB_Uuid() { - my $fhem_dbh = _cfgDB_Connect; - my $uuid; - $uuid = $fhem_dbh->selectrow_array('select lower(hex(randomblob(16)))') if($cfgDB_dbtype eq 'SQLITE'); - $uuid = $fhem_dbh->selectrow_array('select uuid()') if($cfgDB_dbtype eq 'MYSQL'); - $uuid = $fhem_dbh->selectrow_array('select uuid_generate_v4()') if($cfgDB_dbtype eq 'POSTGRESQL'); - $fhem_dbh->disconnect(); - return $uuid; + return createUniqueId(); } ##################################################