projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Leeren String in undef für anständige DB-Abfrage umwandeln
[kivitendo-erp.git]
/
SL
/
LxOfficeConf.pm
diff --git
a/SL/LxOfficeConf.pm
b/SL/LxOfficeConf.pm
index
b0d8010
..
8f44016
100644
(file)
--- a/
SL/LxOfficeConf.pm
+++ b/
SL/LxOfficeConf.pm
@@
-6,9
+6,14
@@
use Config::Std;
use Encode;
sub read {
use Encode;
sub read {
- my $file = -f 'config/lx_office.conf' ? 'config/lx_office.conf' : 'config/lx_office.conf.default';
- read_config $file => %::lx_office_conf;
+ read_config 'config/lx_office.conf.default' => %::lx_office_conf;
_decode_recursively(\%::lx_office_conf);
_decode_recursively(\%::lx_office_conf);
+
+ if (-f 'config/lx_office.conf') {
+ read_config 'config/lx_office.conf' => my %local_conf;
+ _decode_recursively(\%local_conf);
+ _flat_merge(\%::lx_office_conf, \%local_conf);
+ }
}
sub _decode_recursively {
}
sub _decode_recursively {
@@
-23,4
+28,17
@@
sub _decode_recursively {
}
}
}
}
+sub _flat_merge {
+ my ($dst, $src) = @_;
+
+ while (my ($key, $value) = each %{ $src }) {
+ if (!exists $dst->{$key}) {
+ $dst->{$key} = $value;
+
+ } else {
+ map { $dst->{$key}->{$_} = $value->{$_} } keys %{ $value };
+ }
+ }
+}
+
1;
1;