| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Apache::Session::Browseable::File; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
3571
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
64
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
1071
|
use Apache::Session; |
|
|
2
|
|
|
|
|
3831
|
|
|
|
2
|
|
|
|
|
66
|
|
|
6
|
2
|
|
|
2
|
|
940
|
use Apache::Session::Lock::File; |
|
|
2
|
|
|
|
|
5224
|
|
|
|
2
|
|
|
|
|
67
|
|
|
7
|
2
|
|
|
2
|
|
942
|
use Apache::Session::Browseable::Store::File; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
68
|
|
|
8
|
2
|
|
|
2
|
|
908
|
use Apache::Session::Generate::SHA256; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
72
|
|
|
9
|
2
|
|
|
2
|
|
906
|
use Apache::Session::Serialize::JSON; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
77
|
|
|
10
|
2
|
|
|
2
|
|
906
|
use Apache::Session::Browseable::_common; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
174
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
2
|
|
33
|
2
|
|
17
|
use constant SL => ( $^O and $^O =~ /(?:MSWin|Windows)/i ? '\\' : '/' ); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
1340
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '1.3.5'; |
|
15
|
|
|
|
|
|
|
our @ISA = qw(Apache::Session Apache::Session::Browseable::_common); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub populate { |
|
18
|
28
|
|
|
28
|
0
|
2778
|
my $self = shift; |
|
19
|
|
|
|
|
|
|
|
|
20
|
28
|
|
|
|
|
145
|
$self->{object_store} = new Apache::Session::Browseable::Store::File $self; |
|
21
|
28
|
|
|
|
|
633
|
$self->{lock_manager} = new Apache::Session::Lock::File $self; |
|
22
|
28
|
|
|
|
|
190
|
$self->{generate} = \&Apache::Session::Generate::SHA256::generate; |
|
23
|
28
|
|
|
|
|
53
|
$self->{validate} = \&Apache::Session::Generate::SHA256::validate; |
|
24
|
28
|
|
|
|
|
44
|
$self->{serialize} = \&Apache::Session::Serialize::JSON::serialize; |
|
25
|
28
|
|
|
|
|
51
|
$self->{unserialize} = \&Apache::Session::Serialize::JSON::unserialize; |
|
26
|
|
|
|
|
|
|
|
|
27
|
28
|
|
|
|
|
48
|
return $self; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub DESTROY { |
|
31
|
28
|
|
|
28
|
|
14385
|
my $self = shift; |
|
32
|
|
|
|
|
|
|
|
|
33
|
28
|
|
|
|
|
87
|
$self->save; |
|
34
|
28
|
|
|
|
|
3716
|
$self->{object_store}->close; |
|
35
|
28
|
|
|
|
|
2020
|
$self->release_all_locks; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_key_from_all_sessions { |
|
39
|
11
|
|
|
11
|
0
|
497
|
my ( $class, $args, $data ) = @_; |
|
40
|
11
|
|
33
|
|
|
36
|
$args->{Directory} ||= $Apache::Session::Store::File::Directory; |
|
41
|
|
|
|
|
|
|
|
|
42
|
11
|
50
|
|
|
|
428
|
unless ( opendir DIR, $args->{Directory} ) { |
|
43
|
0
|
|
|
|
|
0
|
die "Cannot open directory $args->{Directory}\n"; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
my @t = |
|
46
|
11
|
100
|
|
|
|
576
|
grep { -f $args->{Directory} . SL . $_ and /^[A-Za-z0-9@\-]+$/ } |
|
|
330
|
|
|
|
|
5368
|
|
|
47
|
|
|
|
|
|
|
readdir(DIR); |
|
48
|
11
|
|
|
|
|
179
|
closedir DIR; |
|
49
|
11
|
|
|
|
|
34
|
my %res; |
|
50
|
11
|
|
|
|
|
28
|
for my $f (@t) { |
|
51
|
308
|
|
|
|
|
524
|
eval { |
|
52
|
308
|
50
|
|
|
|
11976
|
open F, $args->{Directory} . SL . $f or die $!; |
|
53
|
308
|
|
|
|
|
6082
|
my $row = join '', ; |
|
54
|
308
|
100
|
|
|
|
1345
|
if ( ref($data) eq 'CODE' ) { |
|
|
|
100
|
|
|
|
|
|
|
55
|
224
|
|
|
|
|
732
|
$res{$f} = |
|
56
|
|
|
|
|
|
|
&$data( &Apache::Session::Serialize::JSON::_unserialize($row), |
|
57
|
|
|
|
|
|
|
$f ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
elsif ($data) { |
|
60
|
56
|
50
|
|
|
|
132
|
$data = [$data] unless ( ref($data) ); |
|
61
|
56
|
|
|
|
|
169
|
my $tmp = &Apache::Session::Serialize::JSON::_unserialize($row); |
|
62
|
56
|
|
|
|
|
313
|
$res{$f}->{$_} = $tmp->{$_} foreach (@$data); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
else { |
|
65
|
28
|
|
|
|
|
92
|
$res{$f} = |
|
66
|
|
|
|
|
|
|
&Apache::Session::Serialize::JSON::_unserialize($row); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
}; |
|
69
|
308
|
50
|
|
|
|
919
|
if ($@) { |
|
70
|
0
|
|
|
|
|
0
|
print STDERR "Error in session $f: $@\n"; |
|
71
|
0
|
|
|
|
|
0
|
delete $res{$f}; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
} |
|
74
|
11
|
|
|
|
|
246
|
return \%res; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
|
78
|
|
|
|
|
|
|
__END__ |