line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Demo::Basic::Util::Config; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
978
|
use Config::Tiny; |
|
1
|
|
|
|
|
1109
|
|
|
1
|
|
|
|
|
33
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
880
|
use Hash::FieldHash qw(:all); |
|
1
|
|
|
|
|
1970
|
|
|
1
|
|
|
|
|
415
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
fieldhash my %config => 'config'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.06'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ----------------------------------------------- |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
0
|
|
my($class, $config_name) = @_; |
16
|
0
|
|
|
|
|
|
my($self) = bless({}, $class); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my($name); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
for (keys %INC) |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
0
|
|
|
|
|
next if ($_ !~ m|CGI/Application/Demo/Basic/Util/Config.pm|); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
($name = $INC{$_}) =~ s|Config.pm|$config_name|; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$self -> config(Config::Tiny -> read($name) ); |
28
|
0
|
|
|
|
|
|
$self -> config(${$self -> config}{_}); |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} # End of new. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# -------------------------------------------------- |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |