line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
878
|
use 5.001001; |
|
1
|
|
|
|
|
4
|
|
2
|
|
|
|
|
|
|
package Mojolicious::Plugin::MySQLViewerLite::Base; |
3
|
1
|
|
|
1
|
|
5
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
4
|
1
|
|
|
1
|
|
1354
|
use DBIx::Custom; |
|
1
|
|
|
|
|
51049
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
786
|
use Validator::Custom; |
|
1
|
|
|
|
|
15667
|
|
|
1
|
|
|
|
|
11
|
|
6
|
1
|
|
|
1
|
|
50
|
use File::Basename 'dirname'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
72
|
|
7
|
1
|
|
|
1
|
|
7
|
use Cwd 'abs_path'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
8
|
1
|
|
|
1
|
|
6
|
use Carp 'croak'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
536
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'prefix'; |
11
|
|
|
|
|
|
|
has validator => sub { |
12
|
|
|
|
|
|
|
my $validator = Validator::Custom->new; |
13
|
|
|
|
|
|
|
$validator->register_constraint( |
14
|
|
|
|
|
|
|
safety_name => sub { |
15
|
|
|
|
|
|
|
my $name = shift; |
16
|
|
|
|
|
|
|
return ($name || '') =~ /^\w+$/ ? 1 : 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
return $validator; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has dbi => sub { DBIx::Custom->new }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has command => sub { croak "Unimplemented" }; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub register { croak "Unimplemented" } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub add_template_path { |
29
|
0
|
|
|
0
|
0
|
|
my ($self, $renderer, $class) = @_; |
30
|
0
|
|
|
|
|
|
$class =~ s/::/\//g; |
31
|
0
|
|
|
|
|
|
$class .= '.pm'; |
32
|
0
|
|
|
|
|
|
my $public = abs_path $INC{$class}; |
33
|
0
|
|
|
|
|
|
$public =~ s/\.pm$//; |
34
|
0
|
|
|
|
|
|
push @{$renderer->paths}, "$public/templates"; |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_static_path { |
38
|
0
|
|
|
0
|
0
|
|
my ($self, $static, $class) = @_; |
39
|
0
|
|
|
|
|
|
$class =~ s/::/\//g; |
40
|
0
|
|
|
|
|
|
$class .= '.pm'; |
41
|
0
|
|
|
|
|
|
my $public = abs_path $INC{$class}; |
42
|
0
|
|
|
|
|
|
$public =~ s/\.pm$//; |
43
|
0
|
|
|
|
|
|
push @{$static->paths}, "$public/public"; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |