File Coverage

blib/lib/Apache/Session/Serialize/UUEncode.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 18 20 90.0


line stmt bran cond sub pod time code
1             #############################################################################
2             #
3             # Apache::Session::Serialize::UUEncode
4             # Serializes session objects using Storable and pack
5             # Copyright(c) 2000 Jeffrey William Baker (jwbaker@acm.org)
6             # Distribute under the Artistic License
7             #
8             ############################################################################
9              
10             package Apache::Session::Serialize::UUEncode;
11              
12 1     1   4201 use strict;
  1         1  
  1         31  
13 1     1   3 use vars qw($VERSION);
  1         1  
  1         31  
14 1     1   4 use Storable qw(nfreeze thaw);
  1         1  
  1         138  
15              
16             $VERSION = '1.00';
17              
18             sub serialize {
19 1     1 0 437 my $session = shift;
20            
21 1         4 $session->{serialized} = pack("u", nfreeze($session->{data}));
22             }
23              
24             sub unserialize {
25 1     1 0 61 my $session = shift;
26            
27 1         9 $session->{data} = thaw(unpack("u", $session->{serialized}));
28             }
29              
30             1;
31              
32             =pod
33              
34             =head1 NAME
35              
36             Apache::Session::Serialize::UUEncode - Use Storable and C
37             to zip up persistent data
38              
39             =head1 SYNOPSIS
40              
41             use Apache::Session::Serialize::UUEncode;
42            
43             $zipped = Apache::Session::Serialize::UUEncode::serialize($ref);
44             $ref = Apache::Session::Serialize::UUEncode::unserialize($zipped);
45              
46             =head1 DESCRIPTION
47              
48             This module fulfills the serialization interface of Apache::Session. It
49             serializes the data in the session object by use of Storable's C and
50             C functions, and Perl's C and C. The serialized data
51             is ASCII text, suitable for storage in backing stores that don't handle binary
52             data gracefully, such as Postgres.
53              
54             =head1 AUTHOR
55              
56             This module was written by Jeffrey William Baker .
57              
58             =head1 SEE ALSO
59              
60             L, L,
61             L