line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gantry::Plugins::Cache; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
53990
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
75
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use File::Spec; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
11
|
use base 'Exporter'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
490
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw( |
10
|
|
|
|
|
|
|
get_callbacks |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %registered_callbacks; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#----------------------------------------------------------- |
16
|
|
|
|
|
|
|
# $class->get_callbacks( $namespace ) |
17
|
|
|
|
|
|
|
#----------------------------------------------------------- |
18
|
|
|
|
|
|
|
sub get_callbacks { |
19
|
0
|
|
|
0
|
1
|
|
my ( $class, $namespace ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
return if ( $registered_callbacks{ $namespace }++ ); |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
warn "Your app needs a 'namespace' method which doesn't return 'Gantry'" |
24
|
|
|
|
|
|
|
if ( $namespace eq 'Gantry' ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return ( |
27
|
0
|
|
|
|
|
|
{ phase => 'post_engine_init', callback => \&initialize } |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#----------------------------------------------------------- |
32
|
|
|
|
|
|
|
# initialize |
33
|
|
|
|
|
|
|
#----------------------------------------------------------- |
34
|
|
|
|
|
|
|
sub initialize { |
35
|
0
|
|
|
0
|
1
|
|
my ($gobj) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$gobj->cache_init(); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |