|
Lines 512-532
with this method.
Link Here
|
| 512 |
|
512 |
|
| 513 |
=cut |
513 |
=cut |
| 514 |
|
514 |
|
| 515 |
my $syspref_cache = Koha::Cache->get_instance(); |
515 |
my $syspref_cache; |
| 516 |
my $use_syspref_cache = 1; |
516 |
my $use_syspref_cache = 1; |
| 517 |
sub preference { |
517 |
sub preference { |
| 518 |
my $self = shift; |
518 |
my $self = shift; |
| 519 |
my $var = shift; # The system preference to return |
519 |
my $var = shift; # The system preference to return |
| 520 |
|
520 |
|
| 521 |
$var = lc $var; |
|
|
| 522 |
|
| 523 |
return $ENV{"OVERRIDE_SYSPREF_$var"} |
521 |
return $ENV{"OVERRIDE_SYSPREF_$var"} |
| 524 |
if defined $ENV{"OVERRIDE_SYSPREF_$var"}; |
522 |
if defined $ENV{"OVERRIDE_SYSPREF_$var"}; |
| 525 |
|
523 |
|
| 526 |
my $cached_var = $use_syspref_cache |
524 |
$var = lc $var; |
| 527 |
? $syspref_cache->get_from_cache("syspref_$var") |
525 |
|
| 528 |
: undef; |
526 |
if ($use_syspref_cache) { |
| 529 |
return $cached_var if defined $cached_var; |
527 |
$syspref_cache = Koha::Cache->get_instance() unless $syspref_cache; |
|
|
528 |
my $cached_var = $syspref_cache->get_from_cache("syspref_$var"); |
| 529 |
return $cached_var if defined $cached_var; |
| 530 |
} |
| 530 |
|
531 |
|
| 531 |
my $syspref; |
532 |
my $syspref; |
| 532 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
533 |
eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; |
| 533 |
- |
|
|