line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Cache::Runtime; |
2
|
98
|
|
|
98
|
|
561
|
use strict; use warnings FATAL => 'all'; |
|
98
|
|
|
98
|
|
187
|
|
|
98
|
|
|
|
|
2819
|
|
|
98
|
|
|
|
|
555
|
|
|
98
|
|
|
|
|
182
|
|
|
98
|
|
|
|
|
3521
|
|
3
|
98
|
|
|
98
|
|
631
|
use parent 'DTL::Fast::Cache'; |
|
98
|
|
|
|
|
172
|
|
|
98
|
|
|
|
|
581
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Runtime cache for compiled templates |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
7
|
|
|
7
|
0
|
22
|
my( $proto, %kwargs ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
|
|
23
|
$kwargs{'cache'} = {}; |
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
|
|
85
|
return $proto->SUPER::new(%kwargs); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub read_data |
18
|
|
|
|
|
|
|
{ |
19
|
92
|
|
|
92
|
0
|
141
|
my( $self, $key ) = @_; |
20
|
92
|
50
|
|
|
|
218
|
return if not defined $key; |
21
|
92
|
100
|
|
|
|
468
|
return exists $self->{'cache'}->{$key} ? $self->{'cache'}->{$key}: undef; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub write_data |
26
|
|
|
|
|
|
|
{ |
27
|
53
|
|
|
53
|
0
|
94
|
my( $self, $key, $data ) = @_; |
28
|
53
|
50
|
|
|
|
138
|
return if not defined $key; |
29
|
53
|
50
|
|
|
|
110
|
return if not defined $data; |
30
|
53
|
|
|
|
|
153
|
$self->{'cache'}->{$key} = $data; |
31
|
53
|
|
|
|
|
132
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#@Override |
35
|
|
|
|
|
|
|
sub clear |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
0
|
0
|
|
my( $self ) = @_; |
38
|
0
|
|
|
|
|
|
$self->{'cache'} = {}; |
39
|
0
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |