line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
124946
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
2
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
76
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package CGI::Application::Plugin::TT::Any; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
2
|
|
|
2
|
|
242
|
$CGI::Application::Plugin::TT::Any::VERSION = '0.110080'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: load CGI::Application::Plugin::TT with any TT-compatible class |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
2623
|
use Class::Load 'load_class'; |
|
2
|
|
|
|
|
64091
|
|
|
2
|
|
|
|
|
119
|
|
13
|
2
|
|
|
2
|
|
19
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
164
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
require CGI::Application::Plugin::TT; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
2
|
|
|
2
|
|
18705
|
my $pkg = shift; |
19
|
2
|
|
|
|
|
7
|
my $callpkg = caller; |
20
|
|
|
|
|
|
|
{ |
21
|
2
|
|
|
2
|
|
10
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
|
2
|
|
|
|
|
17
|
|
22
|
2
|
|
|
2
|
|
9
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
477
|
|
23
|
2
|
|
|
|
|
6
|
for (qw( tt_obj )) { |
24
|
2
|
|
|
|
|
4
|
my %target = %{"$callpkg\::"}; |
|
2
|
|
|
|
|
149
|
|
25
|
2
|
100
|
|
|
|
60
|
die "CGI::Application::Plugin::TT needs to be loaded first" if !$target{$_}; |
26
|
1
|
|
|
|
|
2
|
*{"$callpkg\::$_"} = \&{$_}; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
1
|
50
|
|
|
|
101
|
return if !@_; |
30
|
0
|
|
|
|
|
0
|
return $callpkg->tt_config( @_ ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub tt_obj { |
34
|
1
|
|
|
1
|
1
|
5771
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
5
|
my ($tt, $options, $frompkg) = CGI::Application::Plugin::TT::_get_object_or_options($self); |
37
|
|
|
|
|
|
|
|
38
|
1
|
50
|
|
|
|
14
|
return $tt if $tt; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
50
|
|
|
4
|
my $tt_options = $options->{TEMPLATE_OPTIONS} || {}; |
41
|
1
|
|
50
|
|
|
8
|
my $class = delete $tt_options->{CLASS} || 'Template'; |
42
|
1
|
|
|
|
|
6
|
load_class $class; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
33
|
|
|
104
|
$tt = $class->new( $tt_options ) || carp "Can't load Template"; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
33
|
|
|
25607
|
CGI::Application::Plugin::TT::_set_object( $frompkg||$self, $tt ); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
17
|
return $tt; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |