| 1 | package Rose::Conf::FileBased; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Carp(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Rose::Conf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | require Tie::Hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | our @ISA = qw(Rose::Conf Tie::StdHash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | our($CONF_ROOT, %Refresh_Time, $APACHE_CONF_PATH); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | our $REFRESH_TIMEOUT = 60 * 15; # in seconds | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | our $CONF_SUFFIX = '.conf'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | our $LOCAL_CONF_FILE = 'local' . $CONF_SUFFIX; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use constant PRIVATE_PREFIX => '__' . __PACKAGE__ . '::'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | our $Debug = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | sub import | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | my($class) = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 2 | local $Rose::Conf::ExportLevel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 2 | $Rose::Conf::ExportLevel++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | ▶ | $class->Rose::Conf::import(@_) if(@_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | my $conf = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | my %save = %$conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | tie(%$conf, $class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | %$conf = %save; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | sub refresh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
refresh: called CC=6 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | my($class) = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | #return if(time < $Refresh_Time{$class} + $class->refresh_timeout); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 2 | $class->_get_conf_root(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | ▶ | if($CONF_ROOT && -d $CONF_ROOT) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$Rose::Conf::FileBased::CONF_ROOT and -d $Rose::Conf::FileBased::CONF_ROOT
MC/DC50%1/2
$Rose::Conf::FileBased::CONF_ROOT and -d $Rose::Conf::FileBased::CONF_ROOT
$Rose::Conf::FileBased::CONF_ROOT
-d $Rose::Conf::FileBased::CONF_ROOT
Truth table66%2/3
A and B
A= $Rose::Conf::FileBased::CONF_ROOTB= -d $Rose::Conf::FileBased::CONF_ROOT
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | #$Refresh_Time{$class} ||= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | # Local conf file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | my $local_conf = File::Spec->catfile($CONF_ROOT, $LOCAL_CONF_FILE); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | if(-s $local_conf) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | $class->_read_combined_conf($local_conf); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # Package-specific conf file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | my $class_conf = File::Spec->catfile($CONF_ROOT, $class . $CONF_SUFFIX); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | if(-s $class_conf) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $class->_read_class_conf($class_conf); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | my $mod_class = $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | $mod_class =~ s/::/-/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | $class_conf = $CONF_ROOT . '/' . $mod_class . $CONF_SUFFIX; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | ▶ | if(-s $class_conf) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | $class->_read_class_conf($class_conf); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | sub FETCH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 101 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
FETCH: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 101 | my($hash, $key) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 101 | ▶ | unless(exists $hash->{PRIVATE_PREFIX . 'IMPORTED'} || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $hash->{"__Rose::Conf::FileBased::IMPORTED"} or exists $hash->{"__Rose::Conf::FileBased::IMPORTING"}
MC/DC100%2/2
exists $hash->{"__Rose::Conf::FileBased::IMPORTED"} or exists $hash->{"__Rose::Conf::FileBased::IMPORTING"}
exists $hash->{"__Rose::Conf::FileBased::IMPORTED"}
exists $hash->{"__Rose::Conf::FileBased::IMPORTING"}
Truth table100%3/3
A or B
A= exists $hash->{"__Rose::Conf::FileBased::IMPORTED"}B= exists $hash->{"__Rose::Conf::FileBased::IMPORTING"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | exists $hash->{PRIVATE_PREFIX . 'IMPORTING'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 1 | ▶ | $Debug && warn "FETCH $hash { $key }\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 1 | $hash->{PRIVATE_PREFIX . 'IMPORTING'} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 1 | my $class = ref($hash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1 | $class->refresh(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | delete $hash->{PRIVATE_PREFIX . 'IMPORTING'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | $hash->{PRIVATE_PREFIX . 'IMPORTED'}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ## This is broken for now... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | # Do not try refresh when looking up private keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | # unless(index($key, PRIVATE_PREFIX) == 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | # { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | # my $class = ref $hash; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | # if(my $timeout = $class->refresh_timeout) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | # { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | # $Refresh_Time{$class} ||= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | # if(time > $Refresh_Time{$class} + $timeout) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | # { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # $class->refresh; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | Carp::croak "No such conf parameter: '$key'\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 101 | ▶ | unless(index($key, PRIVATE_PREFIX) == 0 || exists $hash->{$key}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
index($key, "__Rose::Conf::FileBased::") == 0 or exists $hash->{$key}
MC/DC100%2/2
index($key, "__Rose::Conf::FileBased::") == 0 or exists $hash->{$key}
index($key, "__Rose::Conf::FileBased::") == 0
exists $hash->{$key}
Truth table100%3/3
A or B
A= index($key, "__Rose::Conf::FileBased::") == 0B= exists $hash->{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 99 | return $hash->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | sub _get_conf_root | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_conf_root: called CC=6 SCAR=25.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 2 | $CONF_ROOT = $ENV{'ROSE_CONF_FILE_ROOT'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 2 | ▶ | if(!$CONF_ROOT && exists $ENV{'MOD_PERL'} && require mod_perl && $mod_perl::VERSION < 1.99) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
not $Rose::Conf::FileBased::CONF_ROOT and exists $ENV{"MOD_PERL"} and require mod_perl and $mod_perl::VERSION < "1.99"
not $Rose::Conf::FileBased::CONF_ROOT and exists $ENV{"MOD_PERL"} and require mod_perl
not $Rose::Conf::FileBased::CONF_ROOT and exists $ENV{"MOD_PERL"}
MC/DC0%0/4
not $Rose::Conf::FileBased::CONF_ROOT and exists $ENV{"MOD_PERL"} and require mod_perl and $mod_perl::VERSION < "1.99"
not $Rose::Conf::FileBased::CONF_ROOT
exists $ENV{"MOD_PERL"}
require mod_perl
$mod_perl::VERSION < "1.99"
Truth table40%2/5
not(A) and B and C and D
A= not $Rose::Conf::FileBased::CONF_ROOTB= exists $ENV{"MOD_PERL"}C= require mod_perlD= $mod_perl::VERSION < "1.99"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $CONF_ROOT = Apache->server_root_relative($APACHE_CONF_PATH); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | $CONF_ROOT = undef unless(-d $CONF_ROOT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | sub refresh_timeout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
refresh_timeout: not called CC=3 SCAR=20.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my($class) = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | return ${$class . '::REFRESH_TIMEOUT'} = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | my $timeout = ${$class . '::REFRESH_TIMEOUT'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | $timeout = $REFRESH_TIMEOUT unless(defined $timeout); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | return $timeout; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | sub _parse_line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 21 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_line: called CC=17 SCAR=30.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 21 | my($class, $conf, $line, $file, $line_num) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 21 | ▶ | return unless($line =~ /\S/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 16 | my($key, $val); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 16 | ▶ | if($line =~ /^((?:[^\\ \t]+|\\.)+)\s*=\s*(\S.*|$)/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 14 | $key = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 14 | $val = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | elsif($line !~ /^(#|$)/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | die "Syntax error in $file on line $line_num: $line\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 2 | else { return } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 14 | ▶ | if(length($key) && length($val)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
length $key and length $val
MC/DC0%0/2
length $key and length $val
length $key
length $val
Truth table33%1/3
A and B
A= length $keyB= length $val
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 14 | ▶ | if($val =~ s/(['"])(.*)\1$/$2/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 8 | ▶ | if($1 eq '"' && index($val, '\\') >= 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$1 eq "\"" and index($val, "\\") != -1
MC/DC100%2/2
$1 eq "\"" and index($val, "\\") != -1
$1 eq "\""
index($val, "\\") != -1
Truth table100%3/3
A and B
A= $1 eq "\""B= index($val, "\\") != -1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 1 | $val = eval qq("$val"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 1 | ▶ | if($@) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | die qq(Invalid value "$val" in $file on line $line_num: $@\n); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | # Hash sub-key access | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 14 | ▶ | if($key =~ m/^(?:[^\\: \t]+|\\.)+:/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 4 | my $original_key = $key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 4 | ▶ | if($key =~ /^(?:[^\\: \t]+|\\.)+:$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | Carp::croak qq($class - Invalid hash sub-key access: "$key", ), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | qq(missing key name after final ':' in $file line $line_num); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 4 | my @parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 4 | my $param = $conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 4 | my $prev_param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 4 | ▶ | while($key =~ m/\G((?:[^\\: \t]+|\\.)+)(?::|$)/g) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 13 | $prev_param = $param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 13 | ▶ | $param = $param->{$1} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$param->{$1} ||= {}
MC/DC100%1/1
$param->{$1} ||= {}
$param->{$1}
Truth table100%2/2
A
A= $param->{$1}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 13 | push(@parts, $1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 13 | $parts[-1] =~ s{\\(.)}{$1}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 4 | ▶ | $Debug && warn "\$${class}::CONF{", join('}{', @parts), "} = $val\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 4 | $prev_param->{$parts[-1]} = $val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 4 | $key = $original_key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 10 | $key =~ s{\\(.)}{$1}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 10 | ▶ | $Debug && warn "\$${class}::CONF{$key} = $val\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 10 | $conf->{$key} = $val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 10 | $key =~ s{:}{\\:}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | $Debug && warn "\$${class}::CONF{$key} = undef\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | $conf->{$key} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | $key =~ s{:}{\\:}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 14 | $conf->{PRIVATE_PREFIX . 'MODIFIED'}{$key} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | file => $file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | line_number => $line_num, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | #time => time(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | sub _read_class_conf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_read_class_conf: called CC=3 SCAR=11.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 1 | my($class, $file) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 1 | ▶ | unless(open(CONF, $file)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | warn "Could not open $file: $!"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | #$Refresh_Time{$class} = time; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 1 | my $conf = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | ▶ | while(<CONF>) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 9 | s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 9 | s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 9 | $class->_parse_line($conf, $_, $file, $.); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 1 | close(CONF); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | sub _read_combined_conf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_read_combined_conf: called CC=7 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 1 | my($class, $file) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 1 | my $conf_fh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 1 | ▶ | unless(open($conf_fh, $file)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | warn "Could not open $file: $!"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | #$Refresh_Time{$class} = time; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 1 | my $conf = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 1 | my $in_domain = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 1 | my $in_domain_re = qr(^CLASS\s+$class$); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | my $out_domain_re = qr(^CLASS\s*(?!=)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | ▶ | while(<$conf_fh>) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 17 | s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 17 | s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 17 | ▶ | if(/$in_domain_re/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 1 | $in_domain = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | ▶ | elsif($in_domain && /$out_domain_re/) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$in_domain and /$out_domain_re/
MC/DC0%0/2
$in_domain and /$out_domain_re/
$in_domain
/$out_domain_re/
Truth table66%2/3
A and B
A= $in_domainB= /$out_domain_re/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | $in_domain = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 16 | ▶ | next unless($in_domain); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 12 | $class->_parse_line($conf, $_, $file, $.); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 1 | close($conf_fh); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | sub local_conf_keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
local_conf_keys: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 1 | my($class) = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 1 | my $conf = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | return keys(%{$conf->{PRIVATE_PREFIX . 'MODIFIED'}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | sub local_conf_setting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
local_conf_setting: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 6 | my($class, $key) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 6 | ▶ | Carp::croak "Cannot get setting without $key" unless(defined($key)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 6 | my $conf = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 6 | ▶ | return unless($conf->{PRIVATE_PREFIX . 'MODIFIED'}{$key}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 5 | return bless($conf->{PRIVATE_PREFIX . 'MODIFIED'}{$key}, 'Rose::Conf::File::Setting'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | sub local_conf_value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
local_conf_value: called CC=8 SCAR=21.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 6 | my($class, $key) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 6 | ▶ | Carp::croak "Cannot get setting without $key" unless(defined($key)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 6 | ▶ | $class->local_conf_setting($key) || return undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 5 | ▶ | if($key =~ m/^(?:[^\\: \t]+|\\.)+:/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 2 | ▶ | if($key =~ /^(?:[^\\: \t]+|\\.)+:$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | Carp::croak qq($class - Invalid hash sub-key access: "$key" - missing key name after final ':'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 2 | my @parts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 2 | my $param = $class->conf_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 2 | my $prev_param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 2 | ▶ | while($key =~ m/\G((?:[^\\: \t]+|\\.)+)(?::|$)/g) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 7 | $prev_param = $param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 7 | ▶ | $param = $param->{$1} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$param->{$1} ||= {}
MC/DC0%0/1
$param->{$1} ||= {}
$param->{$1}
Truth table50%1/2
A
A= $param->{$1}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 7 | push(@parts, $1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 7 | $parts[-1] =~ s{\\(.)}{$1}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 2 | ▶ | $Debug && warn "Get local conf value for \$${class}::CONF{", join('}{', @parts), "}\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 2 | return $prev_param->{$parts[-1]}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 3 | $key =~ s{\\:}{:}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 3 | return $class->param($key); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | BEGIN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 1 | $APACHE_CONF_PATH = 'conf/perl'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | #_get_conf_root(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 1 | require Rose::Object; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 1 | @Rose::Conf::File::Setting::ISA = qw(Rose::Object); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | # =item B<refresh_timeout SECS> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | # If an argument is provided, sets the class's refresh timeout to SECS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | # seconds. Returns the class's current refresh timeout in seconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | # The refresh timeout is used to determine when (if ever) to refresh the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | # configuration hash by re-reading the (possibly changed) configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | # file(s). The configuration file(s) will only be re-read if they have | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | # been modified since they were last read (as determined by the files' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | # "mtime"). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | # If the refresh timeout is zero, the files are never re-read. The | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | # default refresh timeout is 15 minutes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||