line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Plugin::MobileAgent; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
27380
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
85
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
5
|
2
|
|
|
2
|
|
11315
|
use NEXT; |
|
2
|
|
|
|
|
6750
|
|
|
2
|
|
|
|
|
60
|
|
6
|
2
|
|
|
2
|
|
1501
|
use Catalyst::Request; |
|
2
|
|
|
|
|
769647
|
|
|
2
|
|
|
|
|
99
|
|
7
|
2
|
|
|
2
|
|
1952
|
use HTTP::MobileAgent; |
|
2
|
|
|
|
|
43436
|
|
|
2
|
|
|
|
|
384
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.041'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
package Catalyst::Request; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub mobile_agent { |
15
|
3
|
|
|
3
|
0
|
359278
|
my $self = shift; |
16
|
3
|
50
|
|
|
|
17
|
unless ( $self->{ mobile_agent } ) { |
17
|
3
|
|
|
|
|
83
|
$self->{ mobile_agent } = HTTP::MobileAgent->new( $self->headers ); |
18
|
|
|
|
|
|
|
} |
19
|
3
|
|
|
|
|
726
|
return $self->{ mobile_agent }; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Catalyst::Plugin::MobileAgent - HTTP mobile user agent string parser plugin for Catalyst |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Catalyst 'MobileAgent'; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
if ($c->request->mobile_agent->is_docomo) { |
32
|
|
|
|
|
|
|
# do something |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Catalyst plugin parsed user agent string for mobile in Japan. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 EXTENDED METHODS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 prepare_headers |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Sets mobile_agent using L<HTTP::MobileAgent>. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHODS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 mobile_agent |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Returns an instance of HTTP::MobileAgent. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
L<HTTP::MobileAgent>, L<Catalyst::Request> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Yoshiki Kurihara, C<< <kurihara at cpan.org> >> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 LICENSE |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
62
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; # End of Catalyst::Plugin::MobileAgent |