File Coverage

blib/lib/Apache/Session/Store/NoSQL.pm
Criterion Covered Total %
statement 6 25 24.0
branch 0 6 0.0
condition n/a
subroutine 2 7 28.5
pod 0 5 0.0
total 8 43 18.6


line stmt bran cond sub pod time code
1             package Apache::Session::Store::NoSQL;
2              
3 1     1   7 use strict;
  1         1  
  1         28  
4 1     1   3 use vars qw(@ISA $VERSION);
  1         1  
  1         317  
5              
6             $VERSION = '0.2';
7              
8             sub new {
9 0     0 0   my ( $class, $session ) = @_;
10 0           my $self;
11              
12 0 0         if ( $session->{args}->{Driver} ) {
13             my $module = 'Apache::Session::Store::NoSQL::'
14 0           . $session->{args}->{Driver};
15 0           eval "require $module";
16 0 0         if ($@) {
17 0           die 'Unable to load ' . $module;
18             }
19 0 0         unless ( $self->{cache} = new $module ( $session ) ) {
20 0           die 'Unable to instanciate ' . $module;
21             }
22             }
23             else {
24 0           die 'No driver specified.';
25             }
26              
27 0           bless $self,$class;
28             }
29              
30             sub insert {
31 0     0 0   my ( $self, $session ) = @_;
32 0           $self->{cache}->insert( $session );
33             }
34              
35             sub update {
36 0     0 0   my ( $self, $session ) = @_;
37 0           $self->{cache}->update( $session );
38             }
39              
40             sub materialize {
41 0     0 0   my ( $self, $session ) = @_;
42 0           $session->{serialized} = $self->{cache}->materialize( $session );
43             }
44              
45             sub remove {
46 0     0 0   my ( $self, $session ) = @_;
47 0           $self->{cache}->remove( $session );
48             }
49              
50             1;
51              
52             __END__
53              
54             =head1 NAME
55              
56             Apache::Session::Store::NoSQL
57              
58             =head1 SYNOPSIS
59              
60             =head1 DESCRIPTION
61              
62             =head1 SEE ALSO
63              
64             =head1 AUTHOR
65              
66             Thomas Chemineau, E<lt>thomas.chemineau@gmail.comE<gt>
67              
68             =head1 COPYRIGHT AND LICENSE
69              
70             Copyright (C) 2010 by Thomas Chemineau
71              
72             This library is free software; you can redistribute it and/or modify
73             it under the same terms as Perl itself, either Perl version 5.10.0 or,
74             at your option, any later version of Perl 5 you may have available.
75              
76             =cut