View | Details | Raw Unified | Return to bug 11921
Collapse All | Expand All

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

Return to bug 11921