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

(-)a/C4/Cache.pm (-7 / +6 lines)
Lines 1-4 Link Here
1
package C4::Cache;
1
package Koha::Cache;
2
2
3
# Copyright 2009 Chris Cormack and The Koha Dev Team
3
# Copyright 2009 Chris Cormack and The Koha Dev Team
4
#
4
#
Lines 19-25 package C4::Cache; Link Here
19
19
20
=head1 NAME
20
=head1 NAME
21
21
22
C4::Cache - Handling caching of html and Objects for Koha
22
Koha::Cache - Handling caching of html and Objects for Koha
23
23
24
=head1 SYNOPSIS
24
=head1 SYNOPSIS
25
25
Lines 49-65 use Carp; Link Here
49
49
50
use base qw(Class::Accessor);
50
use base qw(Class::Accessor);
51
51
52
use C4::Cache::Memcached;
52
use Koha::Cache::Memcached;
53
53
54
__PACKAGE__->mk_ro_accessors( qw( cache ) );
54
__PACKAGE__->mk_ro_accessors( qw( cache ) );
55
55
56
sub new {
56
sub new {
57
    my $class = shift;                                                          
57
    my $class = shift;                                                          
58
    my %param = @_;                                                             
58
    my $param = shift;                                                             
59
    
59
    my $cache_type = $param->{cache_type} || 'memcached';
60
    my $cache_type = $param{cache_type} || 'memcached';
61
    my $subclass = __PACKAGE__."::".ucfirst($cache_type);
60
    my $subclass = __PACKAGE__."::".ucfirst($cache_type);
62
    my $cache    = $subclass->_cache_handle(\%param)
61
    my $cache    = $subclass->_cache_handle($param)
63
      or croak "Cannot create cache handle for '$cache_type'";
62
      or croak "Cannot create cache handle for '$cache_type'";
64
    return bless $class->SUPER::new({cache => $cache}), $subclass;              
63
    return bless $class->SUPER::new({cache => $cache}), $subclass;              
65
}
64
}
(-)a/C4/Cache/Memcached.pm (-4 / +3 lines)
Lines 1-4 Link Here
1
package C4::Cache::Memcached;
1
package Koha::Cache::Memcached;
2
2
3
# Copyright 2009 Chris Cormack and The Koha Dev Team
3
# Copyright 2009 Chris Cormack and The Koha Dev Team
4
#
4
#
Lines 23-36 use Carp; Link Here
23
23
24
use Cache::Memcached;
24
use Cache::Memcached;
25
25
26
use base qw(C4::Cache);
26
use base qw(Koha::Cache);
27
27
28
sub _cache_handle {
28
sub _cache_handle {
29
    my $class  = shift;
29
    my $class  = shift;
30
    my $params = shift;
30
    my $params = shift;
31
32
    my @servers = split /,/, $params->{'cache_servers'};
31
    my @servers = split /,/, $params->{'cache_servers'};
33
34
    return Cache::Memcached->new(
32
    return Cache::Memcached->new(
35
        servers   => \@servers,
33
        servers   => \@servers,
36
        namespace => $params->{'namespace'} || 'KOHA',
34
        namespace => $params->{'namespace'} || 'KOHA',
Lines 40-45 sub _cache_handle { Link Here
40
sub set_in_cache {
38
sub set_in_cache {
41
    my ( $self, $key, $value, $expiry ) = @_;
39
    my ( $self, $key, $value, $expiry ) = @_;
42
    croak "No key" unless $key;
40
    croak "No key" unless $key;
41
    $self->cache->set_debug;
43
42
44
    if ( defined $expiry ) {
43
    if ( defined $expiry ) {
45
        return $self->cache->set( $key, $value, $expiry );
44
        return $self->cache->set( $key, $value, $expiry );
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 328-331 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
330
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
330
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
331
331
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('usecache',0,'If on pages with caching enabled will use caching',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 4549-4554 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4549
    print "Upgrade to $DBversion done Koha 3.6.0 release \n";
4549
    print "Upgrade to $DBversion done Koha 3.6.0 release \n";
4550
    SetVersion ($DBversion);
4550
    SetVersion ($DBversion);
4551
}
4551
}
4552
$DBversion = "3.06.00.xxx";
4553
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4554
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('usecache',0,'If on pages with caching enabled will use caching',NULL,'YesNo')");
4555
    print "Upgradet to $DBversion done (Added syspref usecache, When this preference is turned on pages with with caching support will use caching) \n";
4556
    SetVersion ($DBversion);
4557
}
4552
4558
4553
=head1 FUNCTIONS
4559
=head1 FUNCTIONS
4554
4560
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-2 / +9 lines)
Lines 94-97 Administration: Link Here
94
            - of CAS when logging out of Koha.
94
            - of CAS when logging out of Koha.
95
        -
95
        -
96
            - The CAS Authentication Server can be found at
96
            - The CAS Authentication Server can be found at
97
            - pref: casServerUrl           
97
            - pref: casServerUrl
98
    Caching options:
99
      -
100
          - pref: usecache
101
            default: 0
102
            choices:
103
              yes: Use
104
              no: "Don't use"
105
          - memcached caching
98
- 

Return to bug 7248