line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Session::Store::OnMemory; |
2
|
15
|
|
|
15
|
|
25317
|
use strict; |
|
15
|
|
|
|
|
39
|
|
|
15
|
|
|
|
|
490
|
|
3
|
15
|
|
|
15
|
|
74
|
use warnings; |
|
15
|
|
|
|
|
37
|
|
|
15
|
|
|
|
|
432
|
|
4
|
15
|
|
|
15
|
|
74
|
use base qw/Class::Accessor::Fast/; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
6370
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->mk_ro_accessors(qw/data/); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
19
|
|
|
19
|
1
|
1125
|
my $class = shift; |
10
|
19
|
50
|
|
|
|
118
|
my %args = ref($_[0]) ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
11
|
|
|
|
|
|
|
# set default values |
12
|
19
|
|
100
|
|
|
144
|
$args{data} ||= {}; |
13
|
19
|
|
|
|
|
222
|
bless {%args}, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub select { |
17
|
29
|
|
|
29
|
1
|
287
|
my ( $self, $session_id ) = @_; |
18
|
29
|
100
|
|
|
|
475
|
Carp::croak "missing session_id" unless $session_id; |
19
|
27
|
|
|
|
|
152
|
$self->data->{$session_id}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub insert { |
23
|
28
|
|
|
28
|
1
|
1287
|
my ($self, $session_id, $data) = @_; |
24
|
28
|
100
|
|
|
|
284
|
Carp::croak "missing session_id" unless $session_id; |
25
|
26
|
|
|
|
|
102
|
$self->data->{$session_id} = $data; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub update { |
29
|
4
|
|
|
4
|
1
|
1645
|
my ($self, $session_id, $data) = @_; |
30
|
4
|
100
|
|
|
|
217
|
Carp::croak "missing session_id" unless $session_id; |
31
|
2
|
|
|
|
|
6
|
$self->data->{$session_id} = $data; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub delete { |
35
|
5
|
|
|
5
|
1
|
962
|
my ($self, $session_id) = @_; |
36
|
5
|
100
|
|
|
|
225
|
Carp::croak "missing session_id" unless $session_id; |
37
|
3
|
|
|
|
|
14
|
delete $self->data->{$session_id}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
0
|
|
sub cleanup { Carp::croak "This storage doesn't support cleanup" } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |