Revision 424d6ead
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Dispatcher.pm | ||
---|---|---|
81 | 81 |
my ($self) = @_; |
82 | 82 |
|
83 | 83 |
SL::LxOfficeConf->read; |
84 |
_init_environment(); |
|
85 | 84 |
|
86 | 85 |
eval { |
87 | 86 |
package main; |
... | ... | |
370 | 369 |
return $self->{interface} =~ m/f(?:ast)cgi/i ? $self->{request}->GetHandles() : (\*STDIN, \*STDOUT, \*STDERR); |
371 | 370 |
} |
372 | 371 |
|
373 |
sub _init_environment { |
|
374 |
my %key_map = ( lib => { name => 'PERL5LIB', append_path => 1 }, |
|
375 |
path => { name => 'PATH', append_path => 1 }, |
|
376 |
); |
|
377 |
my $cfg = $::lx_office_conf{environment} || {}; |
|
378 |
|
|
379 |
while (my ($key, $value) = each %{ $cfg }) { |
|
380 |
next unless $value; |
|
381 |
|
|
382 |
my $info = $key_map{$key} || {}; |
|
383 |
$key = $info->{name} || $key; |
|
384 |
|
|
385 |
if ($info->{append_path}) { |
|
386 |
$value = ':' . $value unless $value =~ m/^:/ || !$ENV{$key}; |
|
387 |
$value = $ENV{$key} . $value; |
|
388 |
} |
|
389 |
|
|
390 |
$ENV{$key} = $value; |
|
391 |
} |
|
392 |
} |
|
393 |
|
|
394 | 372 |
sub _check_for_old_config_files { |
395 | 373 |
my @old_files = grep { -f "config/${_}" } qw(authentication.pl console.conf lx-erp.conf lx-erp-local.conf); |
396 | 374 |
return unless @old_files; |
Auch abrufbar als: Unified diff
In Konfiguration angegebene Anwendungen in PATH suchen
Fix für Bug 1690.