Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2b82ec61

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 2b82ec612a736bff7e0588846da09facd9bda1c8
  • Vorgänger 61352a49
  • Nachfolger f2af9def

Initialisierung von %ENV von lx-erp.conf nach lx_office.conf verschoben

Unterschiede anzeigen:

SL/Dispatcher.pm
77 77

  
78 78
  read_config 'config/lx_office.conf' => %::lx_office_conf;
79 79
  _decode_recursively(\%::lx_office_conf);
80
  _init_environment();
80 81

  
81 82
  eval {
82 83
    package main;
......
334 335
  }
335 336
}
336 337

  
338
sub _init_environment {
339
  my %key_map = ( lib  => { name => 'PERL5LIB', append_path => 1 },
340
                  path => { name => 'PATH',     append_path => 1 },
341
                );
342
  my $cfg     = $::lx_office_conf{environment} || {};
343

  
344
  while (my ($key, $value) = each %{ $cfg }) {
345
    next unless $value;
346

  
347
    my $info = $key_map{$key} || {};
348
    $key     = $info->{name}  || $key;
349

  
350
    if ($info->{append_path}) {
351
      $value = ':' . $value unless $value =~ m/^:/ || !$ENV{$key};
352
      $value = $ENV{$key} . $value;
353
    }
354

  
355
    $ENV{$key} = $value;
356
  }
357
}
358

  
337 359
package main;
338 360

  
339 361
use strict;

Auch abrufbar als: Unified diff