From: Will Budic Date: Fri, 28 Feb 2020 09:33:31 +0000 (+1100) Subject: Updated anon and contants, spec. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=0f3038b4e123d8c85095f3448aee59b190b09bd1;p=LifeLog.git Updated anon and contants, spec. --- diff --git a/htdocs/cgi-bin/CNF_SnippetsTesting.pl b/htdocs/cgi-bin/CNF_SnippetsTesting.pl index 766bbdb..c2b4db7 100755 --- a/htdocs/cgi-bin/CNF_SnippetsTesting.pl +++ b/htdocs/cgi-bin/CNF_SnippetsTesting.pl @@ -5,17 +5,43 @@ # use strict; use warnings; -use Try::Tiny; +use DBI; +use Exception::Class; -my $s1 ="`1`2`3`te\\`s\\`t`the best`"; - $s1 =~ s/\\`/\\f/g; - #print $s1,"\n"; -foreach ( split ( /`/, $s1) ){ - $_ =~ s/\\f/`/g; - print $_,"\n"; -} -print "Home:".$ENV{'PWD'}.$ENV{'NL'}; +use lib "system/modules"; +use lib $ENV{'PWD'}.'/htdocs/cgi-bin/system/modules'; + +require Settings; + + +my $dsn = "DBI:SQLite:dbname=/home/will/dev/LifeLog/dbLifeLog/data_admin_log.db"; +my $db = DBI->connect( $dsn, "admin", "admin", { PrintError => 0, RaiseError => 1 } ) + or Exception->throw("Connect failed [$_]"); + +Settings::getConfiguration($db,{backup_enabled=>1}); + +print "backup_enabled1:[".Settings::anon('backup_enabled')."]\n"; +my @r = Settings::anons(); +print "anon_size:[".@r."]@r\n"; + + +Settings::getConfiguration($db); +print "backup_enabled2:[".Settings::anon('backup_enabled')."]\n"; +Settings::getConfiguration($db,{backup_enabled=>1}); +print "backup_enabled3:[".Settings::anon('backup_enabled')."]\n"; +Settings::getConfiguration($db);#Murky waters, can't update an anon later through code. +print "backup_enabled4:[".Settings::anon('backup_enabled')."]\n"; + +# my $s1 ="`1`2`3`te\\`s\\`t`the best`"; + +# $s1 =~ s/\\`/\\f/g; +# #print $s1,"\n"; +# foreach ( split ( /`/, $s1) ){ +# $_ =~ s/\\f/`/g; +# print $_,"\n"; +# } +# print "Home:".$ENV{'PWD'}.$ENV{'NL'};