line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! perl |
2
|
|
|
|
|
|
|
# $Id:$ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package CGI::Application::Plugin::Config::IniFiles; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
80358
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
51
|
|
7
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
8
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
34
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use CGI::Application; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
11
|
1
|
|
|
1
|
|
13
|
use Config::IniFiles; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
6
|
use base "Exporter"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
340
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw( config_file config cfg ); |
16
|
|
|
|
|
|
|
our $VERSION = (qw$Revision: $)[1]; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub config_file { |
19
|
2
|
|
|
2
|
1
|
7178
|
my($self,$file,%opt) = @_; |
20
|
2
|
100
|
|
|
|
9
|
if ( ref($file) eq 'Config::IniFiles' ) { |
21
|
|
|
|
|
|
|
# it's not a file after all, it's a Config::IniFiles object |
22
|
|
|
|
|
|
|
# useful for persistent environments like FastCGI |
23
|
1
|
|
|
|
|
6
|
$self->{'__CONFIG_INIFILES'}->{'__CONFIG'} = $file; |
24
|
|
|
|
|
|
|
} else { |
25
|
1
|
|
|
|
|
5
|
$self->{'__CONFIG_INIFILES'}->{'__FILE_NAME'} = $file; |
26
|
1
|
|
|
|
|
12
|
$self->{'__CONFIG_INIFILES'}->{'__CONFIG'} = Config::IniFiles->new('-file' => $file,%opt); |
27
|
|
|
|
|
|
|
} |
28
|
2
|
|
|
|
|
3072
|
return $file; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub config { |
32
|
2
|
|
|
2
|
1
|
32467
|
return $_[0]->{'__CONFIG_INIFILES'}->{'__CONFIG'}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub cfg { |
36
|
2
|
|
|
2
|
0
|
79
|
return $_[0]->{'__CONFIG_INIFILES'}->{'__CONFIG'}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |