line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Cache::Runtime; |
2
|
98
|
|
|
98
|
|
340
|
use strict; use warnings FATAL => 'all'; |
|
98
|
|
|
98
|
|
104
|
|
|
98
|
|
|
|
|
2466
|
|
|
98
|
|
|
|
|
307
|
|
|
98
|
|
|
|
|
118
|
|
|
98
|
|
|
|
|
2794
|
|
3
|
98
|
|
|
98
|
|
326
|
use parent 'DTL::Fast::Cache'; |
|
98
|
|
|
|
|
111
|
|
|
98
|
|
|
|
|
430
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Runtime cache for compiled templates |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
7
|
|
|
7
|
0
|
16
|
my( $proto, %kwargs ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
|
|
22
|
$kwargs{'cache'} = {}; |
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
|
|
90
|
return $proto->SUPER::new(%kwargs); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub read_data |
18
|
|
|
|
|
|
|
{ |
19
|
92
|
|
|
92
|
0
|
115
|
my( $self, $key ) = @_; |
20
|
92
|
50
|
|
|
|
192
|
return if not defined $key; |
21
|
92
|
100
|
|
|
|
442
|
return exists $self->{'cache'}->{$key} ? $self->{'cache'}->{$key}: undef; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub write_data |
26
|
|
|
|
|
|
|
{ |
27
|
53
|
|
|
53
|
0
|
65
|
my( $self, $key, $data ) = @_; |
28
|
53
|
50
|
|
|
|
109
|
return if not defined $key; |
29
|
53
|
50
|
|
|
|
94
|
return if not defined $data; |
30
|
53
|
|
|
|
|
125
|
$self->{'cache'}->{$key} = $data; |
31
|
53
|
|
|
|
|
79
|
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; |