Revision 18a9b190
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB.pm | ||
---|---|---|
54 | 54 |
}); |
55 | 55 |
} |
56 | 56 |
|
57 |
my %flattened_settings = _flatten_settings(%connect_settings); |
|
58 |
|
|
57 | 59 |
$domain = 'LXOFFICE' if $type =~ m/^LXOFFICE/; |
58 |
$type .= join($SUBSCRIPT_SEPARATOR, map { $::connect_setings{$_} } sort keys %connect_settings);
|
|
60 |
$type .= join($SUBSCRIPT_SEPARATOR, map { ($_, $flattened_settings{$_}) } sort keys %flattened_settings);
|
|
59 | 61 |
my $idx = "${domain}::${type}"; |
60 | 62 |
|
61 | 63 |
if (!$_db_registered{$idx}) { |
... | ... | |
70 | 72 |
return ($domain, $type); |
71 | 73 |
} |
72 | 74 |
|
75 |
sub _flatten_settings { |
|
76 |
my %settings = @_; |
|
77 |
my %flattened = (); |
|
78 |
|
|
79 |
while (my ($key, $value) = each %settings) { |
|
80 |
if ('HASH' eq ref $value) { |
|
81 |
%flattened = ( %flattened, _flatten_settings(%{ $value }) ); |
|
82 |
} else { |
|
83 |
$flattened{$key} = $value; |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 |
return %flattened; |
|
88 |
} |
|
89 |
|
|
73 | 90 |
1; |
Auch abrufbar als: Unified diff
Fix für: Datenbankverbindungen bei identischen Verbindungseinstellungen nur einmal bei Rose registrieren