line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Email::Blaster::Model::Dynamic; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
5
|
2
|
|
|
2
|
|
9
|
use warnings 'all'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
48
|
|
6
|
2
|
|
|
2
|
|
304
|
use Email::Blaster::ConfigLoader; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
172
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#============================================================================== |
10
|
|
|
|
|
|
|
sub import |
11
|
|
|
|
|
|
|
{ |
12
|
2
|
|
|
2
|
|
6
|
my $caller = caller(0); |
13
|
|
|
|
|
|
|
# Use dynamic inheritance. Because this is Perl. Because we can.
|
14
|
2
|
|
|
|
|
10
|
my $config = Email::Blaster::ConfigLoader->load();
|
15
|
0
|
|
|
|
|
|
(my $pkg = $config->database->orm_base_class . ".pm") =~ s/::/\//g;
|
16
|
0
|
0
|
|
|
|
|
require $pkg unless $INC{$pkg}; |
17
|
2
|
|
|
2
|
|
13
|
no strict 'refs'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
164
|
|
18
|
0
|
|
|
|
|
|
push @{"$caller\::ISA"}, $config->database->orm_base_class; |
|
0
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$caller->connection( |
20
|
|
|
|
|
|
|
$config->database->dsn, |
21
|
|
|
|
|
|
|
$config->database->username, |
22
|
|
|
|
|
|
|
$config->database->password |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
}# end import() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1;# return true: |
27
|
|
|
|
|
|
|
|