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
|
|
251911
|
use 5.008; |
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
6
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp 'croak'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
75
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.02'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
50
|
1
|
|
38
|
$ENV{CONFIGAPPENV} = $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
451
|
use Config::App; |
|
1
|
|
|
|
|
59684
|
|
|
1
|
|
|
|
|
7
|
|
16
|
1
|
|
|
1
|
|
5645
|
use Mojolicious::Commands; |
|
1
|
|
|
|
|
192503
|
|
|
1
|
|
|
|
|
8
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $mojo_app_lib; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub import { |
21
|
1
|
|
|
1
|
|
10
|
my ( $self, $this_mojo_app_lib ) = @_; |
22
|
1
|
|
33
|
|
|
11
|
$mojo_app_lib = $this_mojo_app_lib || Config::App->new->get('mojo_app_lib'); |
23
|
1
|
|
|
|
|
3418
|
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__ |