| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Apache::Session::Browseable::File; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
3606
|
use strict; |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
60
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
1186
|
use Apache::Session; |
|
|
2
|
|
|
|
|
4125
|
|
|
|
2
|
|
|
|
|
62
|
|
|
6
|
2
|
|
|
2
|
|
953
|
use Apache::Session::Lock::File; |
|
|
2
|
|
|
|
|
5284
|
|
|
|
2
|
|
|
|
|
67
|
|
|
7
|
2
|
|
|
2
|
|
902
|
use Apache::Session::Browseable::Store::File; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
61
|
|
|
8
|
2
|
|
|
2
|
|
912
|
use Apache::Session::Generate::SHA256; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
65
|
|
|
9
|
2
|
|
|
2
|
|
902
|
use Apache::Session::Serialize::JSON; |
|
|
2
|
|
|
|
|
9
|
|
|
|
2
|
|
|
|
|
76
|
|
|
10
|
2
|
|
|
2
|
|
857
|
use Apache::Session::Browseable::_common; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
167
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
2
|
|
33
|
2
|
|
15
|
use constant SL => ( $^O and $^O =~ /(?:MSWin|Windows)/i ? '\\' : '/' ); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
1315
|
|
|
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
|
2672
|
my $self = shift; |
|
19
|
|
|
|
|
|
|
|
|
20
|
28
|
|
|
|
|
136
|
$self->{object_store} = new Apache::Session::Browseable::Store::File $self; |
|
21
|
28
|
|
|
|
|
654
|
$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
|
|
|
|
|
48
|
$self->{serialize} = \&Apache::Session::Serialize::JSON::serialize; |
|
25
|
28
|
|
|
|
|
44
|
$self->{unserialize} = \&Apache::Session::Serialize::JSON::unserialize; |
|
26
|
|
|
|
|
|
|
|
|
27
|
28
|
|
|
|
|
66
|
return $self; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub DESTROY { |
|
31
|
28
|
|
|
28
|
|
14983
|
my $self = shift; |
|
32
|
|
|
|
|
|
|
|
|
33
|
28
|
|
|
|
|
86
|
$self->save; |
|
34
|
28
|
|
|
|
|
3332
|
$self->{object_store}->close; |
|
35
|
28
|
|
|
|
|
1904
|
$self->release_all_locks; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_key_from_all_sessions { |
|
39
|
11
|
|
|
11
|
0
|
379
|
my ( $class, $args, $data ) = @_; |
|
40
|
11
|
|
33
|
|
|
39
|
$args->{Directory} ||= $Apache::Session::Store::File::Directory; |
|
41
|
|
|
|
|
|
|
|
|
42
|
11
|
50
|
|
|
|
399
|
unless ( opendir DIR, $args->{Directory} ) { |
|
43
|
0
|
|
|
|
|
0
|
die "Cannot open directory $args->{Directory}\n"; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
my @t = |
|
46
|
11
|
100
|
|
|
|
534
|
grep { -f $args->{Directory} . SL . $_ and /^[A-Za-z0-9@\-]+$/ } |
|
|
330
|
|
|
|
|
5213
|
|
|
47
|
|
|
|
|
|
|
readdir(DIR); |
|
48
|
11
|
|
|
|
|
199
|
closedir DIR; |
|
49
|
11
|
|
|
|
|
59
|
my %res; |
|
50
|
11
|
|
|
|
|
31
|
for my $f (@t) { |
|
51
|
308
|
|
|
|
|
491
|
eval { |
|
52
|
308
|
50
|
|
|
|
11841
|
open F, $args->{Directory} . SL . $f or die $!; |
|
53
|
308
|
|
|
|
|
6074
|
my $row = join '', ; |
|
54
|
308
|
100
|
|
|
|
1369
|
if ( ref($data) eq 'CODE' ) { |
|
|
|
100
|
|
|
|
|
|
|
55
|
224
|
|
|
|
|
768
|
$res{$f} = |
|
56
|
|
|
|
|
|
|
&$data( &Apache::Session::Serialize::JSON::_unserialize($row), |
|
57
|
|
|
|
|
|
|
$f ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
elsif ($data) { |
|
60
|
56
|
50
|
|
|
|
139
|
$data = [$data] unless ( ref($data) ); |
|
61
|
56
|
|
|
|
|
171
|
my $tmp = &Apache::Session::Serialize::JSON::_unserialize($row); |
|
62
|
56
|
|
|
|
|
313
|
$res{$f}->{$_} = $tmp->{$_} foreach (@$data); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
else { |
|
65
|
28
|
|
|
|
|
94
|
$res{$f} = |
|
66
|
|
|
|
|
|
|
&Apache::Session::Serialize::JSON::_unserialize($row); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
}; |
|
69
|
308
|
50
|
|
|
|
864
|
if ($@) { |
|
70
|
0
|
|
|
|
|
0
|
print STDERR "Error in session $f: $@\n"; |
|
71
|
0
|
|
|
|
|
0
|
delete $res{$f}; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
} |
|
74
|
11
|
|
|
|
|
250
|
return \%res; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
|
78
|
|
|
|
|
|
|
__END__ |