Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
=cut
-my $syspref_cache = Koha::Caches->get_instance('syspref');
+my $syspref_cache;
my $use_syspref_cache = 1;
sub preference {
my $self = shift;
$var = lc $var;
if ($use_syspref_cache) {
- $syspref_cache = Koha::Cache->get_instance() unless $syspref_cache;
+ $syspref_cache = Koha::Caches->get_instance('syspref') unless $syspref_cache;
my $cached_var = $syspref_cache->get_from_cache("syspref_$var");
return $cached_var if defined $cached_var;
}
}
- SetEnv MEMCACHED_NAMESPACE "localhost:11211"
- RequestHeader add X-Koha-SetEnv "MEMCACHED_NAMESPACE localhost:11211"
=head1 DESCRIPTION
=cut
my $allowed_setenvs = qr/^(
- MEMCACHED_SERVERS |
- MEMCACHED_NAMESPACE |
OVERRIDE_SYSPREF_(\w+) |
OVERRIDE_SYSPREF_NAMES |
OPAC_CSS_OVERRIDE |
%setenvs
};
- # We also add the MEMCACHED_ settings to the actual environment, to make sure any early
- # initialization of Koha::Cache correctly sets up a memcached connection.
- foreach my $special_var ( qw( MEMCACHED_SERVERS MEMCACHED_NAMESPACE ) ) {
- $ENV{$special_var} = $setenvs{$special_var} if defined $setenvs{$special_var};
- }
-
return $self->app->($env);
}