| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
635
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
31
|
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
24
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Amon2::Setup::Flavor::Lite; |
|
6
|
1
|
|
|
1
|
|
40
|
use parent qw(Amon2::Setup::Flavor); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub run { |
|
9
|
1
|
|
|
1
|
0
|
56316
|
my ($self) = @_; |
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
473
|
require Amon2::Lite; |
|
12
|
1
|
|
|
|
|
8
|
require Amon2; |
|
13
|
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
4
|
$self->{amon2_version} = $Amon2::VERSION; |
|
15
|
1
|
|
|
|
|
4
|
$self->{amon2_lite_version} = $Amon2::Lite::VERSION; |
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
12
|
$self->write_file('app.psgi', <<'...'); |
|
18
|
|
|
|
|
|
|
use strict; |
|
19
|
|
|
|
|
|
|
use warnings; |
|
20
|
|
|
|
|
|
|
use utf8; |
|
21
|
|
|
|
|
|
|
use File::Spec; |
|
22
|
|
|
|
|
|
|
use File::Basename; |
|
23
|
|
|
|
|
|
|
use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5'); |
|
24
|
|
|
|
|
|
|
use lib File::Spec->catdir(dirname(__FILE__), 'lib'); |
|
25
|
|
|
|
|
|
|
use Amon2::Lite; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# put your configuration here |
|
30
|
|
|
|
|
|
|
sub load_config { |
|
31
|
|
|
|
|
|
|
my $c = shift; |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $mode = $c->mode_name || 'development'; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
+{ |
|
36
|
|
|
|
|
|
|
'DBI' => [ |
|
37
|
|
|
|
|
|
|
"dbi:SQLite:dbname=$mode.db", |
|
38
|
|
|
|
|
|
|
'', |
|
39
|
|
|
|
|
|
|
'', |
|
40
|
|
|
|
|
|
|
], |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
get '/' => sub { |
|
45
|
|
|
|
|
|
|
my $c = shift; |
|
46
|
|
|
|
|
|
|
return $c->render('index.tt'); |
|
47
|
|
|
|
|
|
|
}; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# load plugins |
|
50
|
|
|
|
|
|
|
__PACKAGE__->load_plugin('Web::CSRFDefender' => { |
|
51
|
|
|
|
|
|
|
post_only => 1, |
|
52
|
|
|
|
|
|
|
}); |
|
53
|
|
|
|
|
|
|
# __PACKAGE__->load_plugin('DBI'); |
|
54
|
|
|
|
|
|
|
# __PACKAGE__->load_plugin('Web::FillInFormLite'); |
|
55
|
|
|
|
|
|
|
# __PACKAGE__->load_plugin('Web::JSON'); |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__PACKAGE__->enable_session(); |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__PACKAGE__->to_app(handle_static => 1); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__DATA__ |