| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Reply::Plugin::ORM::Teng; |
|
2
|
1
|
|
|
1
|
|
1641
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
38
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use List::Compare; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Module::Load; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
7
|
|
|
7
|
1
|
|
|
1
|
|
35
|
use Path::Tiny; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
363
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my @UNNECESSARY_METHODS = qw/ |
|
10
|
|
|
|
|
|
|
new BEGIN DESTROY Iterator:: QueryBuilder:: Row:: Schema:: Plugin:: VERSION SQL_COMMENT_LEVEL load_plugin schema schema_class suppress_row_objects |
|
11
|
|
|
|
|
|
|
/; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
|
14
|
0
|
|
|
0
|
0
|
|
my ($class, $db_name, $config, %opts) = @_; |
|
15
|
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
eval { require Teng }; |
|
|
0
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
Carp::croak "[Error] Module 'Teng' not found." if $@; |
|
18
|
0
|
|
|
|
|
|
eval { require Teng::Schema::Loader }; |
|
|
0
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
Carp::croak "[Error] Module 'Teng::Schema::Loader' not found." if $@; |
|
20
|
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
load 'Teng'; |
|
22
|
0
|
|
|
|
|
|
load 'Teng::Schema::Loader'; |
|
23
|
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if ($opts{teng_plugins}) { |
|
25
|
0
|
|
|
|
|
|
Teng->load_plugin($_) for split /,/, $opts{teng_plugins}; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
0
|
|
|
|
|
|
my $orm = Teng::Schema::Loader->load( |
|
28
|
|
|
|
|
|
|
connect_info => $config->{connect_info}, |
|
29
|
|
|
|
|
|
|
namespace => 'Reply::Plugin::ORM::Teng::DB', |
|
30
|
|
|
|
|
|
|
suppress_row_objects => 1, |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $list = List::Compare->new([ grep { $_ !~ /^_/ } keys %{Teng::} ], \@UNNECESSARY_METHODS); |
|
|
0
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my @methods = map { s/(^.)/uc $1/e; $_ } $list->get_Lonly; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return bless { |
|
37
|
|
|
|
|
|
|
orm => $orm, |
|
38
|
|
|
|
|
|
|
methods => \@methods, |
|
39
|
|
|
|
|
|
|
}, $class; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |