Bug 41896: Remove C4::Context from Koha::Cache

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Amended-by: Jonathan Druart
Restore ||= op
-    $self->{namespace} = Koha::Config->get_instance->get('memcached_namespace') || 'koha';
+    $self->{namespace} ||= Koha::Config->get_instance->get('memcached_namespace') || 'koha';

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2026-02-20 11:16:08 +01:00 committed by Pedro Amorim
parent d154cda830
commit e1072702f8
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 3 additions and 4 deletions

View File

@ -45,9 +45,8 @@ use Module::Load::Conditional qw( can_load );
use Sereal::Encoder; use Sereal::Encoder;
use Sereal::Decoder; use Sereal::Decoder;
use C4::Context;
use Koha::Cache::Object;
use Koha::Config; use Koha::Config;
use Koha::Cache::Object;
use base qw(Class::Accessor); use base qw(Class::Accessor);
@ -76,8 +75,8 @@ sub new {
# Should we continue to support MEMCACHED ENV vars? # Should we continue to support MEMCACHED ENV vars?
$self->{'namespace'} ||= $ENV{MEMCACHED_NAMESPACE}; $self->{'namespace'} ||= $ENV{MEMCACHED_NAMESPACE};
my @servers = split /,/, $ENV{MEMCACHED_SERVERS} || ''; my @servers = split /,/, $ENV{MEMCACHED_SERVERS} || '';
$self->{namespace} ||= C4::Context->config('memcached_namespace') || 'koha'; $self->{namespace} ||= Koha::Config->get_instance->get('memcached_namespace') || 'koha';
@servers = split /,/, C4::Context->config('memcached_servers') // '' @servers = split /,/, Koha::Config->get_instance->get('memcached_servers') // ''
unless @servers; unless @servers;
$self->{namespace} .= ":$subnamespace:"; $self->{namespace} .= ":$subnamespace:";