Session/Store/MySQL.pm

filter: Statementstmt 93.1% 27 / 29 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 4 totaltotal 83.6% 41 / 49 CC 5 SCAR 5.5
CC
5
Cov
89%
remove
2.3
connection
2.1
insert
2.0
CRAP 1.7
« Session/Generate/SHA256.pm ↑ Summary Session/Cassandra.pm »
1 package Web::Session::Store::MySQL;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 12 ▶use Web::Session::Store::DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Apache::Session::Store::MySQL;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 our @ISA =
9 qw(Web::Session::Store::DBI Apache::Session::Store::MySQL);
10 12 our $VERSION = '1.2.0';
11  
12 10 ▶sub connection {
Subroutine connection: called CC=2 SCAR=7.6
Pod undocumented
13 10 my ( $self, $session ) = @_;
14  
15 # AutoCommit on: see "Why AutoCommit differs" in Store/DBI.pm
16 10 $self->_connection( $session, 'Apache::Session::Store::MySQL',
17 { RaiseError => 1, AutoCommit => 1 } );
18 10 ▶ if ( $self->{dbh}->{Driver}->{Name} eq "mysql" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"dbh"}{"Driver"}{"Name"} eq "mysql") 0 10 10
19 0 $self->{dbh}->{mysql_enable_utf8} = 1;
20 }
21 }
22  
23 # A new session is written once (see "New sessions written once" in
24 # Store/DBI.pm), unless the caller gives its own Handle
25 8 ▶sub insert {
Subroutine insert: called CC=2 SCAR=6.9
Pod undocumented
26 8 my ( $self, $session ) = @_;
27 return $self->SUPER::insert($session)
28 8 ▶ if ( exists $session->{args}->{Handle} );
Branch: 1 branch
BranchTrueFalseTotal
if exists $session->{"args"}{"Handle"} 1 7 8
29 7 $self->connection($session);
30 7 return $self->_deferInsert($session);
31 }
32  
33 3 ▶sub update {
Subroutine update: called CC=2 SCAR=6.9
Pod undocumented
34 3 my ( $self, $session ) = @_;
35 3 ▶ return 1 if ( $self->_insertPending($session) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_insertPending($session) 1 1 2
36 1 return $self->SUPER::update($session);
37 }
38  
39 1 ▶sub remove {
Subroutine remove: called CC=2 SCAR=8.1
Pod undocumented
40 1 my ( $self, $session ) = @_;
41 1 ▶ return 1 if ( $self->_removePending );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_removePending 1 0 1
42 0 return $self->SUPER::remove($session);
43 }
44  
45 22 ▶sub DESTROY {
Subroutine DESTROY: called CC=1 SCAR=0.0
46 22 my ($self) = @_;
47 22 $self->_destroyPending;
48 22 $self->SUPER::DESTROY;
49 }
50  
51 12 1;
52  
« Session/Generate/SHA256.pm ↑ Summary Session/Cassandra.pm »