package C4::Context;
+
# Copyright 2002 Katipo Communications
#
# This file is part of Koha.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
-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;
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:";
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 <http://www.gnu.org/licenses>.
+
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};
}
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 <http://www.gnu.org/licenses>.
+
use Modern::Perl;
+
use XML::Simple;
# Default config file, if none is specified