Revision f04a7950
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Dispatcher.pm | ||
---|---|---|
9 | 9 |
} |
10 | 10 |
|
11 | 11 |
use CGI qw( -no_xhtml); |
12 |
use Config::Std; |
|
12 | 13 |
use DateTime; |
14 |
use Encode; |
|
13 | 15 |
use English qw(-no_match_vars); |
14 | 16 |
use SL::Auth; |
15 | 17 |
use SL::LXDebug; |
... | ... | |
92 | 94 |
$::form = undef; |
93 | 95 |
%::myconfig = (); |
94 | 96 |
%::called_subs = (); # currently used for recursion detection |
97 |
|
|
98 |
read_config 'config/lx_office.conf' => %::lx_office_conf if -f "config/lx_office.conf"; |
|
99 |
_decode_recursively(\%::lx_office_conf); |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
$SIG{__WARN__} = sub { |
... | ... | |
320 | 325 |
return $self->{interface} =~ m/f(?:ast)cgi/i ? $self->{request}->GetHandles() : (\*STDIN, \*STDOUT, \*STDERR); |
321 | 326 |
} |
322 | 327 |
|
328 |
sub _decode_recursively { |
|
329 |
my ($obj) = @_; |
|
330 |
|
|
331 |
while (my ($key, $value) = each %{ $obj }) { |
|
332 |
if (ref($value) eq 'HASH') { |
|
333 |
_decode_recursively($value); |
|
334 |
} else { |
|
335 |
$obj->{$key} = decode('UTF-8', $value); |
|
336 |
} |
|
337 |
} |
|
338 |
} |
|
339 |
|
|
323 | 340 |
package main; |
324 | 341 |
|
325 | 342 |
use strict; |
Auch abrufbar als: Unified diff
Zusammenfassen mehrerer Konfigurationsdateien in einer gemeinsamen