line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenPlugin::Config::Conf; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Conf.pm,v 1.9 2003/04/03 01:51:24 andreychek Exp $ |
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
41
|
use strict; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
6576
|
|
6
|
6
|
|
|
6
|
|
46
|
use base qw( OpenPlugin::Config ); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
1058
|
|
7
|
6
|
|
|
6
|
|
50
|
use Log::Log4perl qw( get_logger ); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
61
|
|
8
|
6
|
|
|
6
|
|
16789
|
use Config::General(); |
|
6
|
|
|
|
|
344583
|
|
|
6
|
|
|
|
|
1135
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$OpenPlugin::Config::Conf::VERSION = sprintf("%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $logger = get_logger(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Stuff in metadata (_m): |
15
|
|
|
|
|
|
|
# sections (\@): all full sections, in the order they were read |
16
|
|
|
|
|
|
|
# comments (\%): key is full section name, value is comment scalar |
17
|
|
|
|
|
|
|
# filename ($): file read from |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
######################################## |
21
|
|
|
|
|
|
|
# PUBLIC INTERFACE |
22
|
|
|
|
|
|
|
######################################## |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get_config { |
26
|
7
|
|
|
7
|
0
|
42
|
my ( $self, $filename ) = @_; |
27
|
|
|
|
|
|
|
|
28
|
7
|
|
|
|
|
188
|
my $data = Config::General->new( -ConfigFile => $filename, |
29
|
|
|
|
|
|
|
#-LowerCaseNames => 1, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
7
|
|
|
|
|
66685
|
my %config = $data->getall; |
33
|
|
|
|
|
|
|
|
34
|
7
|
|
|
|
|
961
|
return \%config; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub write { |
39
|
0
|
|
|
0
|
0
|
|
my ( $self, $filename ) = @_; |
40
|
0
|
|
|
|
|
|
$logger->info( "We don't support write yet" ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |