line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAttribute::Agent::Base; |
2
|
27
|
|
|
27
|
|
156
|
use strict; |
|
27
|
|
|
|
|
65
|
|
|
27
|
|
|
|
|
871
|
|
3
|
27
|
|
|
27
|
|
139
|
use warnings; |
|
27
|
|
|
|
|
62
|
|
|
27
|
|
|
|
|
1143
|
|
4
|
|
|
|
|
|
|
require Class::Component; |
5
|
27
|
|
|
27
|
|
142
|
use Carp; |
|
27
|
|
|
|
|
54
|
|
|
27
|
|
|
|
|
2486
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub import { |
8
|
131
|
|
|
131
|
|
415
|
my $pkg = caller(0); |
9
|
|
|
|
|
|
|
|
10
|
27
|
|
|
27
|
|
166
|
no strict 'refs'; |
|
27
|
|
|
|
|
64
|
|
|
27
|
|
|
|
|
15341
|
|
11
|
|
|
|
|
|
|
|
12
|
131
|
|
|
|
|
382
|
*{"$pkg\::mk_accessors"} = \&mk_accessors; |
|
131
|
|
|
|
|
1052
|
|
13
|
131
|
|
|
|
|
507
|
*{"$pkg\::no_match"} = \&_no_match; |
|
131
|
|
|
|
|
717
|
|
14
|
131
|
|
|
684
|
|
800
|
*{"$pkg\::user_agent"} = sub { $_[0]->request->get('User-Agent') }; |
|
131
|
|
|
|
|
724
|
|
|
684
|
|
|
|
|
2083
|
|
15
|
131
|
|
|
520
|
|
721
|
*{"$pkg\::class_component_load_plugin_resolver"} = sub { "HTTP::MobileAttribute::Plugin::$_[1]" }; |
|
131
|
|
|
|
|
933
|
|
|
520
|
|
|
|
|
77994
|
|
16
|
131
|
|
|
|
|
961
|
$pkg->mk_accessors(qw/request carrier_longname/); |
17
|
|
|
|
|
|
|
|
18
|
131
|
50
|
|
|
|
2131
|
unless ($pkg->isa('Class::Component')) { |
19
|
131
|
|
|
|
|
236
|
unshift @{"$pkg\::ISA"}, 'Class::Component'; |
|
131
|
|
|
|
|
1852
|
|
20
|
|
|
|
|
|
|
} |
21
|
131
|
|
|
|
|
1186
|
Class::Component::Implement->init($pkg); |
22
|
|
|
|
|
|
|
|
23
|
131
|
|
|
|
|
3327
|
$pkg->load_components(qw/DisableDynamicPlugin Autocall::InjectMethod AutoloadPlugin/); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _no_match { |
27
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
1
|
50
|
|
|
|
7
|
if ($^W) { |
30
|
1
|
|
|
|
|
3
|
carp( |
31
|
|
|
|
|
|
|
$self->user_agent, |
32
|
|
|
|
|
|
|
": no match. Might be new variants. ", |
33
|
|
|
|
|
|
|
"please contact the author of HTTP::MobileAgent!" |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mk_accessors { |
39
|
236
|
|
|
236
|
0
|
1107
|
my ($class, @methods) = @_; |
40
|
|
|
|
|
|
|
|
41
|
27
|
|
|
27
|
|
198
|
no strict 'refs'; |
|
27
|
|
|
|
|
64
|
|
|
27
|
|
|
|
|
3434
|
|
42
|
236
|
|
|
|
|
546
|
for my $method (@methods) { |
43
|
1048
|
|
|
4423
|
|
3466
|
*{"${class}::${method}"} = sub { $_[0]->{$method} }; |
|
1048
|
|
|
|
|
6954
|
|
|
4423
|
|
|
|
|
26581
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |