line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
190
|
use 5.008; |
|
10
|
|
|
|
|
58
|
|
|
10
|
|
|
|
|
566
|
|
2
|
10
|
|
|
10
|
|
62
|
use strict; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
306
|
|
3
|
10
|
|
|
10
|
|
55
|
use warnings; |
|
10
|
|
|
|
|
306
|
|
|
10
|
|
|
|
|
827
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Hook::Modular::CacheProxy; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
10
|
|
|
10
|
|
819
|
$Hook::Modular::CacheProxy::VERSION = '1.101050'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
# ABSTRACT: Cache proxy for Hook::Modular |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
16
|
|
|
16
|
1
|
135
|
my ($class, $plugin, $cache) = @_; |
13
|
16
|
|
|
|
|
112
|
bless { |
14
|
|
|
|
|
|
|
namespace => $plugin->plugin_id, |
15
|
|
|
|
|
|
|
cache => $cache, |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
for my $meth (qw(get get_callback set remove)) { |
19
|
10
|
|
|
10
|
|
60
|
no strict 'refs'; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
1644
|
|
20
|
|
|
|
|
|
|
*{$meth} = sub { |
21
|
0
|
|
|
0
|
|
|
my $self = shift; |
22
|
0
|
|
|
|
|
|
my $key = shift; |
23
|
0
|
|
|
|
|
|
$key = "$self->{namespace}|$key"; |
24
|
0
|
|
|
|
|
|
$self->{cache}->$meth($key, @_); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub path_to { |
29
|
0
|
|
|
0
|
1
|
|
my ($self, @path) = @_; |
30
|
0
|
|
|
|
|
|
$self->{cache}->path_to($self->{namespace}, @path); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |