line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kelp::Module::Config::ConfigGeneral; |
2
|
5
|
|
|
5
|
|
2489
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
134
|
|
3
|
5
|
|
|
5
|
|
116
|
use 5.008_005; |
|
5
|
|
|
|
|
13
|
|
4
|
5
|
|
|
5
|
|
17
|
use Kelp::Base 'Kelp::Module::Config'; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
27
|
|
5
|
5
|
|
|
5
|
|
53156
|
use Config::General; |
|
5
|
|
|
|
|
60907
|
|
|
5
|
|
|
|
|
1233
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
attr ext => 'conf'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub load { |
12
|
9
|
|
|
9
|
1
|
2137
|
my ( $self, $filename ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
|
|
52
|
my $conf = Config::General->new( |
15
|
|
|
|
|
|
|
-ConfigFile => $filename, |
16
|
|
|
|
|
|
|
-ForceArray => 1, |
17
|
|
|
|
|
|
|
-IncludeAgain => 1, |
18
|
|
|
|
|
|
|
-InterPolateVars => 1, |
19
|
|
|
|
|
|
|
); |
20
|
9
|
|
|
|
|
15436
|
my %config = $conf->getall; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Hack for using default Log::Dispatch |
23
|
9
|
100
|
|
|
|
88
|
if ( exists $config{modules_init}{Logger} ) { |
24
|
2
|
|
|
|
|
4
|
my $outputs = $config{modules_init}{Logger}{outputs}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my @outputs = map { |
27
|
2
|
|
|
|
|
5
|
my ( $k, $v ) = ($_, $outputs->{$_}); |
|
2
|
|
|
|
|
5
|
|
28
|
2
|
|
|
|
|
2
|
my @res; |
29
|
2
|
50
|
|
|
|
12
|
push @res, ( ref $v eq 'ARRAY' ) ? map { [ $k, %$_ ] } @$v |
|
2
|
100
|
|
|
|
6
|
|
30
|
|
|
|
|
|
|
: ( ref $v eq 'HASH' ) ? [ $k, %$v ] |
31
|
|
|
|
|
|
|
: []; |
32
|
2
|
|
|
|
|
7
|
@res; |
33
|
|
|
|
|
|
|
} keys %$outputs; |
34
|
2
|
|
|
|
|
7
|
$config{modules_init}{Logger}{outputs} = \@outputs; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
9
|
|
|
|
|
128
|
return \%config; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |