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
|
|
171526
|
use 5.008; |
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
6
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
7
|
1
|
|
|
1
|
|
4
|
use Carp 'croak'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
59
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.03'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
50
|
1
|
|
37
|
$ENV{CONFIGAPPENV} = $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
404
|
use Config::App; |
|
1
|
|
|
|
|
45920
|
|
|
1
|
|
|
|
|
7
|
|
16
|
1
|
|
|
1
|
|
5092
|
use Mojolicious::Commands; |
|
1
|
|
|
|
|
154921
|
|
|
1
|
|
|
|
|
7
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $mojo_app_lib; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub import { |
21
|
1
|
|
|
1
|
|
8
|
my ( $self, $this_mojo_app_lib ) = @_; |
22
|
1
|
|
33
|
|
|
10
|
$mojo_app_lib = $this_mojo_app_lib || Config::App->new->get('mojo_app_lib'); |
23
|
1
|
|
|
|
|
1934
|
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__ |