line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAttribute::Request; |
2
|
28
|
|
|
28
|
|
652
|
use strict; |
|
28
|
|
|
|
|
88
|
|
|
28
|
|
|
|
|
1056
|
|
3
|
28
|
|
|
28
|
|
139
|
use warnings; |
|
28
|
|
|
|
|
55
|
|
|
28
|
|
|
|
|
808
|
|
4
|
28
|
|
|
28
|
|
178
|
use Carp; |
|
28
|
|
|
|
|
57
|
|
|
28
|
|
|
|
|
2435
|
|
5
|
28
|
|
|
28
|
|
28874
|
use Class::Inspector; |
|
28
|
|
|
|
|
128560
|
|
|
28
|
|
|
|
|
1033
|
|
6
|
28
|
|
|
28
|
|
289
|
use Scalar::Util qw/blessed/; |
|
28
|
|
|
|
|
68
|
|
|
28
|
|
|
|
|
3810
|
|
7
|
28
|
|
|
28
|
|
19756
|
use HTTP::MobileAttribute::Request::Env; |
|
28
|
|
|
|
|
169
|
|
|
28
|
|
|
|
|
834
|
|
8
|
28
|
|
|
28
|
|
17564
|
use HTTP::MobileAttribute::Request::Apache; # for apache1 |
|
28
|
|
|
|
|
85
|
|
|
28
|
|
|
|
|
776
|
|
9
|
28
|
|
|
28
|
|
16906
|
use HTTP::MobileAttribute::Request::APRTable; # for apache2 |
|
28
|
|
|
|
|
83
|
|
|
28
|
|
|
|
|
1108
|
|
10
|
28
|
|
|
28
|
|
17915
|
use HTTP::MobileAttribute::Request::HTTPHeaders; |
|
28
|
|
|
|
|
83
|
|
|
28
|
|
|
|
|
6629
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
745
|
|
|
745
|
0
|
13196
|
my ($class, $stuff) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# This is the not-so-sexy approach that uses less code than the original |
16
|
745
|
|
|
|
|
920
|
my $impl_class; |
17
|
745
|
100
|
100
|
|
|
2632
|
if (! $stuff || ! ref $stuff ) { |
|
|
50
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# first, if $stuff is not defined or is not a reference... |
19
|
743
|
|
|
|
|
1908
|
$impl_class = join("::", __PACKAGE__, "Env"); |
20
|
|
|
|
|
|
|
} elsif (blessed($stuff)) { |
21
|
|
|
|
|
|
|
# or, if it's blessed, check if they are of appropriate types |
22
|
2
|
|
|
|
|
5
|
for my $pkg (qw(Apache HTTP::Headers APR::Table)) { |
23
|
3
|
100
|
|
|
|
26
|
if ($stuff->isa($pkg)) { |
24
|
2
|
|
|
|
|
9
|
$impl_class = join("::", __PACKAGE__, $pkg); |
25
|
|
|
|
|
|
|
# XXX Hack. Will only work for HTTPHeaders & APRTable |
26
|
2
|
|
|
|
|
9
|
$impl_class =~ s/HTTP::Headers$/HTTPHeaders/; |
27
|
2
|
|
|
|
|
4
|
$impl_class =~ s/APR::Table$/APRTable/; |
28
|
2
|
|
|
|
|
5
|
last; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
745
|
50
|
|
|
|
1638
|
if (! $impl_class) { |
34
|
0
|
|
|
|
|
0
|
croak "unknown request type: $stuff"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
745
|
|
|
|
|
3430
|
return $impl_class->new($stuff); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |