Session/Informix.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
populate
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #############################################################################
2 #
3 # Apache::Session::Informix
4 # Apache persistent user sessions in a Informix database
5 # Copyright(c) 2000 Jeffrey William Baker (jwbaker@acm.org)
6 # Distribute under the Perl License
7 #
8 ############################################################################
9
10 package Apache::Session::Informix;
11
12 use strict;
13 use vars qw(@ISA $VERSION);
14
15 $VERSION = '1.01';
16 @ISA = qw(Apache::Session);
17
18 use Apache::Session;
19 use Apache::Session::Lock::Null;
20 use Apache::Session::Store::Informix;
21 use Apache::Session::Generate::MD5;
22 use Apache::Session::Serialize::Base64;
23
24 sub populate {
25 my $self = shift;
26
27 $self->{object_store} = Apache::Session::Store::Informix->new($self);
28 $self->{lock_manager} = Apache::Session::Lock::Null->new($self);
29 $self->{generate} = \&Apache::Session::Generate::MD5::generate;
30 $self->{validate} = \&Apache::Session::Generate::MD5::validate;
31 $self->{serialize} = \&Apache::Session::Serialize::Base64::serialize;
32 $self->{unserialize} = \&Apache::Session::Serialize::Base64::unserialize;
33
34 return $self;
35 }
36
37 1;
38
39 =pod
40
41 =head1 NAME
42
43 Apache::Session::Informix - An implementation of Apache::Session
44
45 =head1 SYNOPSIS
46
47 use Apache::Session::Informix;
48
49 #if you want Apache::Session to open new DB handles:
50
51 tie %hash, 'Apache::Session::Informix', $id, {
52 DataSource => 'dbi:Informix:sessions',
53 UserName => $db_user,
54 Password => $db_pass,
55 Commit => 1
56 };
57
58 #or, if your handles are already opened:
59
60 tie %hash, 'Apache::Session::Informix', $id, {
61 Handle => $dbh,
62 Commit => 1
63 };
64
65 =head1 DESCRIPTION
66
67 This module is an implementation of Apache::Session. It uses the Informix
68 backing store and no locking. See the example, and the documentation for
69 Apache::Session::Store::Informix for more details.
70
71 =head1 USAGE
72
73 The special Apache::Session argument for this module is Commit. You MUST
74 provide the Commit argument, which instructs this module to either commit
75 the transaction when it is finished, or to simply do nothing. This feature
76 is provided so that this module will not have adverse interactions with your
77 local transaction policy, nor your local database handle caching policy. The
78 argument is mandatory in order to make you think about this problem.
79
80 This module also respects the LongReadLen argument, which specifies the maximum
81 size of the session object. If not specified, the default maximum is 8 KB.
82
83 =head1 AUTHOR
84
85 This module was written by Jeffrey William Baker <jwbaker@acm.org>.
86
87 =head1 SEE ALSO
88
89 L<Apache::Session::File>, L<Apache::Session::Flex>,
90 L<Apache::Session::DB_File>, L<Apache::Session::Postgres>, L<Apache::Session>