]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Updated anon and contants, spec.
authorWill Budic <redacted>
Fri, 28 Feb 2020 09:33:31 +0000 (20:33 +1100)
committerWill Budic <redacted>
Fri, 28 Feb 2020 09:33:31 +0000 (20:33 +1100)
htdocs/cgi-bin/CNF_SnippetsTesting.pl

index 766bbdb0dce40ffa3443aebeb98044cfadfce5bc..c2b4db7073942db3ab48cff111df6ef9d6444bdc 100755 (executable)
@@ -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'};