|
Lines 513-518
sub preference {
Link Here
|
| 513 |
|
513 |
|
| 514 |
$var = lc $var; |
514 |
$var = lc $var; |
| 515 |
|
515 |
|
|
|
516 |
return $ENV{"OVERRIDE_SYSPREF_$var"} |
| 517 |
if defined $ENV{"OVERRIDE_SYSPREF_$var"}; |
| 518 |
|
| 516 |
# Return the value if the var has already been accessed |
519 |
# Return the value if the var has already been accessed |
| 517 |
if ($use_syspref_cache && exists $syspref_L1_cache{$var}) { |
520 |
if ($use_syspref_cache && exists $syspref_L1_cache{$var}) { |
| 518 |
return $syspref_L1_cache{$var}; |
521 |
return $syspref_L1_cache{$var}; |
|
Lines 523-536
sub preference {
Link Here
|
| 523 |
: undef; |
526 |
: undef; |
| 524 |
return $cached_var if defined $cached_var; |
527 |
return $cached_var if defined $cached_var; |
| 525 |
|
528 |
|
| 526 |
my $value; |
529 |
my $syspref; |
| 527 |
if ( defined $ENV{"OVERRIDE_SYSPREF_$var"} ) { |
530 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
| 528 |
$value = $ENV{"OVERRIDE_SYSPREF_$var"}; |
531 |
my $value = $syspref ? $syspref->value() : undef; |
| 529 |
} else { |
|
|
| 530 |
my $syspref; |
| 531 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
| 532 |
$value = $syspref ? $syspref->value() : undef; |
| 533 |
} |
| 534 |
|
532 |
|
| 535 |
if ( $use_syspref_cache ) { |
533 |
if ( $use_syspref_cache ) { |
| 536 |
$syspref_cache->set_in_cache("syspref_$var", $value); |
534 |
$syspref_cache->set_in_cache("syspref_$var", $value); |
| 537 |
- |
|
|