File Coverage

blib/lib/Apache/Session/MariaDB.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;
2              
3 1     1   356093 use strict;
  1         2  
  1         32  
4 1     1   3 use warnings;
  1         1  
  1         54  
5              
6 1     1   9 use base 'Apache::Session';
  1         1  
  1         629  
7              
8             our $VERSION = '0.01';
9              
10 1     1   1520 use Apache::Session;
  1         1  
  1         18  
11 1     1   498 use Apache::Session::Lock::MariaDB;
  1         2  
  1         33  
12 1     1   428 use Apache::Session::Store::MariaDB;
  1         4  
  1         40  
13 1     1   693 use Apache::Session::Generate::MD5;
  1         460  
  1         46  
14 1     1   577 use Apache::Session::Serialize::Storable;
  1         433  
  1         150  
15              
16             sub populate {
17 0     0 0   my $self = shift;
18              
19 0           $self->{object_store} = new Apache::Session::Store::MariaDB $self;
20 0           $self->{lock_manager} = new Apache::Session::Lock::MariaDB $self;
21 0           $self->{generate} = \&Apache::Session::Generate::MD5::generate;
22 0           $self->{validate} = \&Apache::Session::Generate::MD5::validate;
23 0           $self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
24 0           $self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
25              
26 0           return $self;
27             }
28              
29             1;
30              
31              
32             =pod
33              
34             =head1 NAME
35              
36             Apache::Session::MariaDB - An implementation of Apache::Session using MariaDB
37              
38             =head1 SYNOPSIS
39              
40             use Apache::Session::MariaDB;
41              
42             #if you want Apache::Session to open new DB handles:
43              
44             tie %hash, 'Apache::Session::MariaDB', $id, {
45             DataSource => 'dbi:MariaDB:sessions',
46             UserName => $db_user,
47             Password => $db_pass,
48             LockDataSource => 'dbi:MariaDB:sessions',
49             LockUserName => $db_user,
50             LockPassword => $db_pass
51             };
52              
53             #or, if your handles are already opened:
54              
55             tie %hash, 'Apache::Session::MariaDB', $id, {
56             Handle => $dbh,
57             LockHandle => $dbh
58             };
59              
60             =head1 DESCRIPTION
61              
62             This module is an implementation of Apache::Session. It uses the
63             MariaDB backing store and the MariaDB locking scheme. See the example,
64             and the documentation for Apache::Session::Store::MariaDB and
65             Apache::Session::Lock::MariaDB for more details.
66              
67             It's based on L but uses L instead
68             of L. The initial reason to create this new module is that
69             L requires to explicitly indicate C column as
70             binary in L's bind_param calls, which is different from L
71             and thus L doesn't support it.
72              
73             =head1 AUTHOR
74              
75             Best Practical Solutions, LLC Emodules@bestpractical.comE
76              
77             Jeffrey William Baker Ejwbaker@acm.orgE
78              
79             Tomas Doran Ebobtfish@bobtfish.net
80              
81             =head1 LICENSE AND COPYRIGHT
82              
83             Copyright (C) 2024, Best Practical Solutions LLC.
84              
85             This library is free software; you can redistribute it and/or modify it
86             under the same terms as Perl itself.
87              
88             =head1 SEE ALSO
89              
90             L, L, L,
91             L, L, L