line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Cache::Runtime; |
2
|
98
|
|
|
98
|
|
591
|
use strict; |
|
98
|
|
|
|
|
212
|
|
|
98
|
|
|
|
|
2750
|
|
3
|
98
|
|
|
98
|
|
461
|
use warnings FATAL => 'all'; |
|
98
|
|
|
|
|
204
|
|
|
98
|
|
|
|
|
2812
|
|
4
|
98
|
|
|
98
|
|
478
|
use parent 'DTL::Fast::Cache'; |
|
98
|
|
|
|
|
178
|
|
|
98
|
|
|
|
|
475
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# Runtime cache for compiled templates |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#@Override |
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
7
|
|
|
7
|
0
|
31
|
my ( $proto, %kwargs ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
7
|
|
|
|
|
28
|
$kwargs{cache} = { }; |
14
|
|
|
|
|
|
|
|
15
|
7
|
|
|
|
|
86
|
return $proto->SUPER::new(%kwargs); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub read_data |
19
|
|
|
|
|
|
|
{ |
20
|
92
|
|
|
92
|
0
|
197
|
my ( $self, $key ) = @_; |
21
|
92
|
50
|
|
|
|
300
|
return if (not defined $key); |
22
|
92
|
100
|
|
|
|
425
|
return exists $self->{cache}->{$key} ? $self->{cache}->{$key} : undef; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub write_data |
27
|
|
|
|
|
|
|
{ |
28
|
53
|
|
|
53
|
0
|
113
|
my ( $self, $key, $data ) = @_; |
29
|
53
|
50
|
|
|
|
143
|
return if (not defined $key); |
30
|
53
|
50
|
|
|
|
123
|
return if (not defined $data); |
31
|
53
|
|
|
|
|
135
|
$self->{cache}->{$key} = $data; |
32
|
53
|
|
|
|
|
121
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#@Override |
36
|
|
|
|
|
|
|
sub clear |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
39
|
0
|
|
|
|
|
|
$self->{cache} = { }; |
40
|
0
|
|
|
|
|
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |