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