File Coverage

blib/lib/Apache/Session/MariaDB/NoLock.pm
Criterion Covered Total %
statement 24 32 75.0
branch n/a
condition n/a
subroutine 8 9 88.8
pod 0 1 0.0
total 32 42 76.1


line stmt bran cond sub pod time code
1             package Apache::Session::MariaDB::NoLock;
2              
3 1     1   1505 use strict;
  1         2  
  1         44  
4 1     1   6 use warnings;
  1         2  
  1         61  
5              
6 1     1   6 use base 'Apache::Session';
  1         2  
  1         91  
7              
8 1     1   7 use Apache::Session;
  1         3  
  1         43  
9 1     1   663 use Apache::Session::Lock::Null;
  1         279  
  1         44  
10 1     1   8 use Apache::Session::Store::MariaDB;
  1         2  
  1         46  
11 1     1   7 use Apache::Session::Generate::MD5;
  1         2  
  1         31  
12 1     1   6 use Apache::Session::Serialize::Storable;
  1         3  
  1         240  
13              
14             sub populate {
15 0     0 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;
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 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. This can cause your session
67             data to be overwritten or stale data to be read by subsequent requests.
68              
69             This B.
70              
71             =head1 AUTHOR
72              
73             Best Practical Solutions, LLC Emodules@bestpractical.comE
74              
75             Tomas Doran Ebobtfish@bobtfish.net
76              
77             =head1 SEE ALSO
78              
79             L, L,
80             L
81              
82             =cut