@@ -, +, @@ --- C4/Context.pm | 7 ++++--- Koha/Cache.pm | 3 ++- Koha/Caches.pm | 19 ++++++++++++++++++- Koha/Config.pm | 16 ++++++++++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) --- a/C4/Context.pm +++ a/C4/Context.pm @@ -1,4 +1,5 @@ package C4::Context; + # Copyright 2002 Katipo Communications # # This file is part of Koha. @@ -16,9 +17,9 @@ package C4::Context; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; -use vars qw($AUTOLOAD $context @context_stack $servers); +use Modern::Perl; + +use vars qw($AUTOLOAD $context @context_stack); BEGIN { if ($ENV{'HTTP_USER_AGENT'}) { require CGI::Carp; --- a/Koha/Cache.pm +++ a/Koha/Cache.pm @@ -88,7 +88,8 @@ sub new { unless ( $self->{namespace} and @servers ) { my $koha_config = Koha::Config->read_from_file( Koha::Config->guess_koha_conf() ); $self->{namespace} ||= $koha_config->{config}{memcached_namespace} || 'koha'; - @servers = split /,/, $koha_config->{config}{memcached_servers} unless @servers; + @servers = split /,/, $koha_config->{config}{memcached_servers} // '' + unless @servers; } $self->{namespace} .= ":$subnamespace:"; --- a/Koha/Caches.pm +++ a/Koha/Caches.pm @@ -1,13 +1,30 @@ package Koha::Caches; +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + use Modern::Perl; + use Koha::Cache; our $singleton_caches; sub get_instance { my ($class, $subnamespace) = @_; $subnamespace //= ''; - $singleton_caches->{$subnamespace} = Koha::Cache->new({}, { subnamespace => $subnamespace } ) unless $singleton_caches->{$subnamespace}; + $singleton_caches->{$subnamespace} = Koha::Cache->new({}, { subnamespace => $subnamespace } ) + unless $singleton_caches->{$subnamespace}; return $singleton_caches->{$subnamespace}; } --- a/Koha/Config.pm +++ a/Koha/Config.pm @@ -1,6 +1,22 @@ package Koha::Config; +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + use Modern::Perl; + use XML::Simple; # Default config file, if none is specified --