| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
222520
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
79
|
|
|
2
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
124
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MasonX::Resolver::Multiplex; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
2824
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN { extends 'HTML::Mason::Resolver' } |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# play nicely with Class::Container |
|
12
|
|
|
|
|
|
|
sub validation_spec { |
|
13
|
|
|
|
|
|
|
my ($self) = @_; |
|
14
|
|
|
|
|
|
|
return { |
|
15
|
|
|
|
|
|
|
%{ $self->SUPER::validation_spec || {} }, |
|
16
|
|
|
|
|
|
|
resolvers => 1, |
|
17
|
|
|
|
|
|
|
}, |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has resolvers => ( |
|
21
|
|
|
|
|
|
|
is => 'rw', |
|
22
|
|
|
|
|
|
|
isa => 'ArrayRef[HTML::Mason::Resolver]', |
|
23
|
|
|
|
|
|
|
lazy => 1, |
|
24
|
|
|
|
|
|
|
auto_deref => 1, |
|
25
|
|
|
|
|
|
|
default => sub { [] }, |
|
26
|
|
|
|
|
|
|
); |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub get_info { |
|
29
|
|
|
|
|
|
|
my $self = shift; |
|
30
|
|
|
|
|
|
|
my @args = @_; |
|
31
|
|
|
|
|
|
|
for my $res ($self->resolvers) { |
|
32
|
|
|
|
|
|
|
my $src = $res->get_info(@args); |
|
33
|
|
|
|
|
|
|
return $src if $src; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
return; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub glob_path { |
|
39
|
|
|
|
|
|
|
my $self = shift; |
|
40
|
|
|
|
|
|
|
my @args = @_; |
|
41
|
|
|
|
|
|
|
for my $res ($self->resolvers) { |
|
42
|
|
|
|
|
|
|
my @paths = $res->glob_path(@args); |
|
43
|
|
|
|
|
|
|
return @paths if @paths; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
return; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub apache_request_to_comp_path { |
|
49
|
|
|
|
|
|
|
my $self = shift; |
|
50
|
|
|
|
|
|
|
my @args = @_; |
|
51
|
|
|
|
|
|
|
for my $res ($self->resolvers) { |
|
52
|
|
|
|
|
|
|
next unless $res->can('apache_request_to_comp_path'); |
|
53
|
|
|
|
|
|
|
my $path = $res->apache_request_to_comp_path(@args); |
|
54
|
|
|
|
|
|
|
return $path if $path; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
return; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
|
60
|
|
|
|
|
|
|
__END__ |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
MasonX::Resolver::Multiplex - multiplex several Resolver objects |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Version 0.001 |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
use MasonX::Resolver::Multiplex; |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my $resolver = MasonX::Resolver::Multiplex->new( |
|
75
|
|
|
|
|
|
|
resolvers => [ |
|
76
|
|
|
|
|
|
|
My::Custom::Resolver->new, |
|
77
|
|
|
|
|
|
|
HTML::Mason::Resolver::File->new, |
|
78
|
|
|
|
|
|
|
], |
|
79
|
|
|
|
|
|
|
); |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
my $interp = HTML::Mason::Interp->new( |
|
82
|
|
|
|
|
|
|
resolver => $resolver, |
|
83
|
|
|
|
|
|
|
# ... other options |
|
84
|
|
|
|
|
|
|
) |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Use this Resolver subclass when you want to combine the behavior of other |
|
89
|
|
|
|
|
|
|
Resolver subclasses, such as in the L</SYNOPSIS>. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This class delegates methods to its contained C<resolvers>. Each method is |
|
92
|
|
|
|
|
|
|
called on each resolver in order; the first to return a true value 'wins'. |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Delegated methods: |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=over |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * get_info |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * glob_path |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * apache_request_to_comp_path (if present) |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=back |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
L<HTML::Mason> |
|
109
|
|
|
|
|
|
|
L<HTML::Mason::Resolver> |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 AUTHOR |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Hans Dieter Pearcey, C<< <hdp at pobox.com> >> |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 BUGS |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-masonx-resolver-multiplex at rt.cpan.org>, or through |
|
118
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MasonX-Resolver-Multiplex>. I will be notified, and then you'll |
|
119
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 SUPPORT |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
perldoc MasonX::Resolver::Multiplex |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
You can also look for information at: |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=over 4 |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MasonX-Resolver-Multiplex> |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
L<http://annocpan.org/dist/MasonX-Resolver-Multiplex> |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/MasonX-Resolver-Multiplex> |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * Search CPAN |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/MasonX-Resolver-Multiplex> |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=back |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Copyright 2008 Hans Dieter Pearcey. |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
157
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |