line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Session::Serialize::YAML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
463
|
use parent 'Data::Session::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
58
|
no autovivification; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
39
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
338
|
use YAML::Tiny (); |
|
1
|
|
|
|
|
4548
|
|
|
1
|
|
|
|
|
124
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.17'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ----------------------------------------------- |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub freeze |
15
|
|
|
|
|
|
|
{ |
16
|
20
|
|
|
20
|
0
|
53
|
my($self, $data) = @_; |
17
|
|
|
|
|
|
|
|
18
|
20
|
|
|
|
|
82
|
return YAML::Tiny::freeze($data); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
} # End of freeze. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# ----------------------------------------------- |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new |
25
|
|
|
|
|
|
|
{ |
26
|
54
|
|
|
54
|
1
|
118
|
my($class) = @_; |
27
|
|
|
|
|
|
|
|
28
|
54
|
|
|
|
|
230
|
return bless({}, $class); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} # End of new. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# ----------------------------------------------- |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub thaw |
35
|
|
|
|
|
|
|
{ |
36
|
28
|
|
|
28
|
0
|
68
|
my($self, $data) = @_; |
37
|
|
|
|
|
|
|
|
38
|
28
|
|
|
|
|
92
|
return YAML::Tiny::thaw($data); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} # End of thaw. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# ----------------------------------------------- |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=pod |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 NAME |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L - A persistent session manager |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 Synopsis |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
See L for details. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 Description |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
L allows L to manipulate sessions with L. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
To use this module do this: |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=over 4 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item o Specify a driver of type YAML as Data::Session -> new(type => '... serialize:YAML') |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 Case-sensitive Options |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
See L for important information. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 Method: new() |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Creates a new object of type L. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
C takes a hash of key/value pairs, some of which might mandatory. Further, some combinations |
77
|
|
|
|
|
|
|
might be mandatory. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
The keys are listed here in alphabetical order. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
They are lower-case because they are (also) method names, meaning they can be called to set or get |
82
|
|
|
|
|
|
|
the value at any time. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item o verbose => $integer |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Print to STDERR more or less information. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Typical values are 0, 1 and 2. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This key is normally passed in as Data::Session -> new(verbose => $integer). |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This key is optional. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 Method: freeze($data) |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Returns $data frozen by L. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 Method: thaw($data) |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Returns $data thawed by L. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 Support |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Log a bug on RT: L. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 Author |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
L was written by Ron Savage Iron@savage.net.auE> in 2010. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Home page: L. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 Copyright |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Australian copyright (c) 2010, Ron Savage. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
All Programs of mine are 'OSI Certified Open Source Software'; |
121
|
|
|
|
|
|
|
you can redistribute them and/or modify them under the terms of |
122
|
|
|
|
|
|
|
The Artistic License, a copy of which is available at: |
123
|
|
|
|
|
|
|
http://www.opensource.org/licenses/index.html |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |