: '' },
get_method => sub { $_[0]->request_method() },
},
- D => undef,
+ Dbh => undef,
};
my ($k,$v);
while (($k,$v,@_) = @_) {
sub _dbopen ($) {
my ($s) = @_;
- my $dbh = $s->{D};
+ my $dbh = $s->{Dbh};
return $dbh if $dbh;
$s->{S}{assocdb_dsn} ||= "dbi:SQLite:dbname=$s->{S}{assocdb_path}";
AutoCommit => 0, RaiseError => 1,
});
die "${assocdb_dsn} $! ?" unless $dbh;
- $s->{D} = $dbh;
+ $s->{Dbh} = $dbh;
$dbh->do("BEGIN");
}
my $r = {
S => $classbase->{S},
- D => $classbase->{D},
- C => $cgi,
+ Dbh => $classbase->{Dbh},
+ Cgi => $cgi,
};
bless $r, ref $classbase;
}
sub _cm ($$@) {
my ($r,$methname, @args) = @_;
my $methfunc = $r->{S}{$methname};
- return $methfunc->($r->{C}, $r, @args);
+ return $methfunc->($r->{Cgi}, $r, @args);
}
sub record_login ($$) {
read($rsf,$nassocbin,$bytes) == $bytes or die "$rsp $!";
close $rsf;
my $nassoc = unpack "H*", $nassocbin;
- my $dbh = $r->{D};
+ my $dbh = $r->{Dbh};
$dbh->do("INSERT INTO $r->{S}{assocdb_table}".
" (associd, username, last) VALUES (?,?,?)", {},
$nassoc, $nusername, time);