line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MojoX::ConfigAppStart; |
2
|
|
|
|
|
|
|
# ABSTRACT: Start a Mojolicious application with Config::App |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
87921
|
use 5.008; |
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
6
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
7
|
1
|
|
|
1
|
|
4
|
use Carp 'croak'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.01'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
50
|
1
|
|
32
|
$ENV{CONFIGAPPENV} = $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
380
|
use Config::App; |
|
1
|
|
|
|
|
49174
|
|
|
1
|
|
|
|
|
5
|
|
16
|
1
|
|
|
1
|
|
4518
|
use Mojolicious::Commands; |
|
1
|
|
|
|
|
119081
|
|
|
1
|
|
|
|
|
5
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $mojo_app_lib; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub import { |
21
|
1
|
|
|
1
|
|
11
|
my ( $self, $this_mojo_app_lib ) = @_; |
22
|
1
|
|
33
|
|
|
9
|
$mojo_app_lib = $this_mojo_app_lib || Config::App->new->get('mojo_app_lib'); |
23
|
1
|
|
|
|
|
97
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub start { |
27
|
0
|
|
|
0
|
1
|
|
my ( $self, $this_mojo_app_lib ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
$mojo_app_lib = $this_mojo_app_lib if ($this_mojo_app_lib); |
30
|
0
|
|
0
|
|
|
|
$mojo_app_lib ||= Config::App->new->get('mojo_app_lib'); |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
croak('Unable to determine the Mojolicious application control library') unless ($mojo_app_lib); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return Mojolicious::Commands->start_app($mojo_app_lib); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |