MariaDB/NoLock.pm

filter: Statementstmt 75.7% 25 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 1 totaltotal 76.7% 33 / 43 CC 1 SCAR 1.1
CC
1
Cov
76%
populate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Store/MariaDB.pm ↑ Summary MariaDB.pm »
1 package Apache::Session::MariaDB::NoLock;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base 'Apache::Session';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Apache::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Apache::Session::Lock::Null;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Apache::Session::Store::MariaDB;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Apache::Session::Generate::MD5;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Apache::Session::Serialize::Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub populate {
Subroutine populate: not called CC=1 SCAR=6.9
Pod undocumented
15 0 my $self = shift;
16  
17 0 $self->{object_store} = Apache::Session::Store::MariaDB->new($self);
18 0 $self->{lock_manager} = Apache::Session::Lock::Null->new($self);
19 0 $self->{generate} = \&Apache::Session::Generate::MD5::generate;
20 0 $self->{validate} = \&Apache::Session::Generate::MD5::validate;
21 0 $self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
22 0 $self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
23  
24 0 return $self;
25 }
26  
27 1 1;
28  
29 =pod
30  
31 =head1 NAME
32  
33 Apache::Session::MariaDB::NoLock - An implementation of Apache::Session::MariaDB without locking
34  
35 =head1 SYNOPSIS
36  
37 use Apache::Session::MariaDB::NoLock;
38  
39 #if you want Apache::Session to open new DB handles:
40  
41 tie %hash, 'Apache::Session::MariaDB::NoLock', $id, {
42 DataSource => 'dbi:MariaDB:sessions',
43 UserName => $db_user,
44 Password => $db_pass,
45 };
46  
47 #or, if your handles are already opened:
48  
49 tie %hash, 'Apache::Session::MariaDB::NoLock', $id, {
50 Handle => $dbh,
51 };
52  
53 To configure the non-locking session store in RT (what I use this module for),
54 put the following into your C<RT_SiteConfig.pm> module:
55  
56 Set($WebSessionClass , 'Apache::Session::MariaDB::NoLock');
57  
58 =head1 DESCRIPTION
59  
60 This module is an implementation of Apache::Session. It uses the MariaDB backing
61 store and the Null locking scheme. See the example, and the documentation for
62 Apache::Session::Store::MariaDB for more details.
63  
64 =head1 WARNING
65  
66 This module explicitly B<DOES NOT DO ANY LOCKING>. This can cause your session
67 data to be overwritten or stale data to be read by subsequent requests.
68  
69 This B<CAN CAUSE LARGE PROBLEMS IN YOUR APPLICATION>.
70  
71 =head1 AUTHOR
72  
73 Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
74  
75 Tomas Doran E<lt>bobtfish@bobtfish.net<gt>
76  
77 =head1 SEE ALSO
78  
79 L<Apache::Session::MariaDB>, L<Apache::Session::Flex>,
80 L<Apache::Session>
81  
82 =cut
« Store/MariaDB.pm ↑ Summary MariaDB.pm »