line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MasonX::Component::Interp; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
382638
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
98
|
|
6
|
1
|
|
|
1
|
|
1118
|
use Class::Inspector; |
|
1
|
|
|
|
|
4397
|
|
|
1
|
|
|
|
|
34
|
|
7
|
1
|
|
|
1
|
|
8
|
use Scalar::Util qw/reftype/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
125
|
|
8
|
1
|
|
|
1
|
|
5
|
use base qw/HTML::Mason::Interp/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51070
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 METHODS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head2 new |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=over 4 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=item Arguments: %params |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=item Return Value: $interp |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=back |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
0
|
|
|
0
|
1
|
|
my ($self, %attrs) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
|
|
|
my $comp_root = exists $attrs{comp_root} |
28
|
|
|
|
|
|
|
? $attrs{comp_root} |
29
|
|
|
|
|
|
|
: $self->validation_spec->{comp_root}->{default}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if (!ref $comp_root) { |
32
|
0
|
|
|
|
|
|
$comp_root = [ [ MAIN => $comp_root ] ]; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
if (reftype $comp_root eq 'ARRAY') { |
36
|
0
|
|
|
|
|
|
my @additional_comp_roots = $self->registry->comp_roots; |
37
|
0
|
|
|
|
|
|
push @{ $comp_root }, @additional_comp_roots; |
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$attrs{comp_root} = $comp_root; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return $self->SUPER::new(%attrs); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 registry_class |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=over 4 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item Arguments: none |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item Return Value: $class |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub registry_class { |
58
|
0
|
|
|
0
|
1
|
|
return 'MasonX::Component::Registry'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 registry |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=over 4 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item Arguments: none |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item Return Value: $class |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=back |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub registry { |
74
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
my $class = $self->registry_class; |
77
|
0
|
|
|
|
|
|
$self->ensure_class_loaded($class); |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
return $class; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 ensure_class_loaded |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item Arguments: none |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item Return Value: none |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub ensure_class_loaded { |
95
|
0
|
|
|
0
|
1
|
|
my ($self, $class) = @_; |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
|
|
|
croak "Invalid class name $class" |
98
|
|
|
|
|
|
|
if $class =~ /(?:\b:\b|\:{3,})/; |
99
|
|
|
|
|
|
|
|
100
|
0
|
0
|
|
|
|
|
return if Class::Inspector->loaded($class); |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
eval "require $class"; |
103
|
0
|
0
|
|
|
|
|
if (my $error = $@) { |
104
|
0
|
|
|
|
|
|
croak $error; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
return; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |