line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Lazy::Session::Data; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use CGI::Lazy::Globals; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
416
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
sub AUTOLOAD { |
9
|
0
|
|
|
0
|
|
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $name = our $AUTOLOAD; |
12
|
0
|
0
|
|
|
|
|
return if $name =~ /::DESTROY$/; |
13
|
0
|
|
|
|
|
|
my @list = split "::", $name; |
14
|
0
|
|
|
|
|
|
my $value = pop @list; |
15
|
0
|
0
|
|
|
|
|
if (@_) { |
16
|
0
|
|
|
|
|
|
$self->{_data}->{$value} = shift; #this will work equally well for scalars and array refs. Do we need it to fly for lists? |
17
|
0
|
0
|
0
|
|
|
|
$self->session->save unless ($self->q->plugin->session->{autowrite} && ($self->q->plugin->session->{autowrite} == 0)); |
18
|
|
|
|
|
|
|
} else { |
19
|
0
|
0
|
|
|
|
|
if (ref $self->{_data}->{$value} eq 'HASH') { |
|
|
0
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
return wantarray ? %{$self->{_data}->{$value}} : $self->{_data}->{$value}; |
|
0
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
} elsif (ref $self->{_data}->{$value} eq 'ARRAY') { |
22
|
0
|
0
|
|
|
|
|
return wantarray ? @{$self->{_data}->{$value}} : $self->{_data}->{$value}; |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} else { |
24
|
0
|
|
|
|
|
|
return $self->{_data}->{$value}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
sub q { |
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return $self->session->q; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
sub session { |
38
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $self->{_session}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------- |
44
|
|
|
|
|
|
|
sub new { |
45
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
46
|
0
|
|
|
|
|
|
my $session = shift; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $self = {_session => $session, _data => $session->getData}; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return bless $self, $class; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |