samples/sess_backed/2/config/development.pl

filter: Statementstmt 100% 32 / 32 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 97.5% 40 / 41 CC 2 SCAR 2.3
CC
2
Cov
97%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« t/scripts/genperl.ytmpl/1/ytmpl/layout.ytmpl ↑ Summary t/scripts/genperl.ytmpl/1/public/index.yatt »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use FindBin;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 my $dbpath = "$FindBin::Bin/var/db/site.db";
8 1 my $schema = "$FindBin::Bin/sql/site.schema.sql";
9  
10 1 ▶my $connector = sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
11 1 my $was_missing = ! -e $dbpath;
12 1 my $dbh = DBI->connect("dbi:SQLite:dbname=$dbpath", '', ''
13 , +{sqlite_unicode => 1});
14 1 ▶ chmod 0664, $dbpath if $was_missing;
Branch: 1 branch
BranchTrueFalseTotal
if $was_missing 1 0 1
15 1 $dbh;
16 1 };
17  
18 {
19 1 my $dbh = $connector->();
20 1 my $sql = do {local (@ARGV, $/) = $schema; scalar <>};
21 1 $dbh->do($sql);
22 }
23  
24 1 ▶use Plack::Session::State::Cookie ();
Subroutine BEGIN: called CC=1 SCAR=0.0
25 # use Plack::Session::Store::DBI ();
26  
27 return +{
28 # Direct object
29 1 session_state =>
30 Plack::Session::State::Cookie->new(httponly => 1)
31  
32 # [$pluginName => @args]
33 , session_store =>
34 [
35 DBI => get_dbh => $connector
36 ]
37 };
« t/scripts/genperl.ytmpl/1/ytmpl/layout.ytmpl ↑ Summary t/scripts/genperl.ytmpl/1/public/index.yatt »