line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::ServerType; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1577
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
155100
|
|
|
2
|
|
|
|
|
13
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub register { |
8
|
1
|
|
|
1
|
1
|
34
|
my ($self, $app, $conf) = (@_); |
9
|
1
|
|
50
|
|
|
4
|
$conf ||= {}; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$app->helper( |
12
|
|
|
|
|
|
|
server_type => sub { |
13
|
1
|
|
|
1
|
|
687
|
return undef; |
14
|
|
|
|
|
|
|
} |
15
|
1
|
|
|
|
|
8
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$app->hook( before_server_start => sub { |
18
|
3
|
|
|
3
|
|
10092
|
my ( $server, $app ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
6
|
my $serverType = ref $server; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$app->helper( |
23
|
|
|
|
|
|
|
server_type => sub { |
24
|
2
|
|
|
|
|
19001
|
return $serverType; |
25
|
|
|
|
|
|
|
} |
26
|
3
|
|
|
|
|
12
|
); |
27
|
1
|
|
|
|
|
122
|
}); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |