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

(-)a/C4/Biblio.pm (-2 / +2 lines)
Lines 1122-1128 sub GetMarcStructure { Link Here
1122
    $frameworkcode = "" unless $frameworkcode;
1122
    $frameworkcode = "" unless $frameworkcode;
1123
1123
1124
    $forlibrarian = $forlibrarian ? 1 : 0;
1124
    $forlibrarian = $forlibrarian ? 1 : 0;
1125
    my $cache = Koha::Cache->get_instance();
1125
    my $cache = Koha::Caches->get_instance();
1126
    my $cache_key = "MarcStructure-$forlibrarian-$frameworkcode";
1126
    my $cache_key = "MarcStructure-$forlibrarian-$frameworkcode";
1127
    my $cached = $cache->get_from_cache($cache_key);
1127
    my $cached = $cache->get_from_cache($cache_key);
1128
    return $cached if $cached;
1128
    return $cached if $cached;
Lines 1230-1236 sub GetMarcSubfieldStructure { Link Here
1230
1230
1231
    $frameworkcode //= '';
1231
    $frameworkcode //= '';
1232
1232
1233
    my $cache     = Koha::Cache->get_instance();
1233
    my $cache     = Koha::Caches->get_instance();
1234
    my $cache_key = "MarcSubfieldStructure-$frameworkcode";
1234
    my $cache_key = "MarcSubfieldStructure-$frameworkcode";
1235
    my $cached    = $cache->get_from_cache($cache_key);
1235
    my $cached    = $cache->get_from_cache($cache_key);
1236
    return $cached if $cached;
1236
    return $cached if $cached;
(-)a/C4/Calendar.pm (-7 / +7 lines)
Lines 276-282 sub insert_single_holiday { Link Here
276
276
277
277
278
    # changed the 'single_holidays' table, lets force/reset its cache
278
    # changed the 'single_holidays' table, lets force/reset its cache
279
    my $cache = Koha::Cache->get_instance();
279
    my $cache = Koha::Caches->get_instance();
280
    $cache->clear_from_cache( 'single_holidays') ;
280
    $cache->clear_from_cache( 'single_holidays') ;
281
    $cache->clear_from_cache( 'exception_holidays') ;
281
    $cache->clear_from_cache( 'exception_holidays') ;
282
282
Lines 321-327 sub insert_exception_holiday { Link Here
321
    $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
321
    $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
322
322
323
    # changed the 'single_holidays' table, lets force/reset its cache
323
    # changed the 'single_holidays' table, lets force/reset its cache
324
    my $cache = Koha::Cache->get_instance();
324
    my $cache = Koha::Caches->get_instance();
325
    $cache->clear_from_cache( 'single_holidays') ;
325
    $cache->clear_from_cache( 'single_holidays') ;
326
    $cache->clear_from_cache( 'exception_holidays') ;
326
    $cache->clear_from_cache( 'exception_holidays') ;
327
327
Lines 422-428 UPDATE special_holidays SET title = ?, description = ? Link Here
422
    $self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
422
    $self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
423
423
424
    # changed the 'single_holidays' table, lets force/reset its cache
424
    # changed the 'single_holidays' table, lets force/reset its cache
425
    my $cache = Koha::Cache->get_instance();
425
    my $cache = Koha::Caches->get_instance();
426
    $cache->clear_from_cache( 'single_holidays') ;
426
    $cache->clear_from_cache( 'single_holidays') ;
427
    $cache->clear_from_cache( 'exception_holidays') ;
427
    $cache->clear_from_cache( 'exception_holidays') ;
428
428
Lines 465-471 UPDATE special_holidays SET title = ?, description = ? Link Here
465
    $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
465
    $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
466
466
467
    # changed the 'single_holidays' table, lets force/reset its cache
467
    # changed the 'single_holidays' table, lets force/reset its cache
468
    my $cache = Koha::Cache->get_instance();
468
    my $cache = Koha::Caches->get_instance();
469
    $cache->clear_from_cache( 'single_holidays') ;
469
    $cache->clear_from_cache( 'single_holidays') ;
470
    $cache->clear_from_cache( 'exception_holidays') ;
470
    $cache->clear_from_cache( 'exception_holidays') ;
471
471
Lines 546-552 sub delete_holiday { Link Here
546
    }
546
    }
547
547
548
    # changed the 'single_holidays' table, lets force/reset its cache
548
    # changed the 'single_holidays' table, lets force/reset its cache
549
    my $cache = Koha::Cache->get_instance();
549
    my $cache = Koha::Caches->get_instance();
550
    $cache->clear_from_cache( 'single_holidays') ;
550
    $cache->clear_from_cache( 'single_holidays') ;
551
    $cache->clear_from_cache( 'exception_holidays') ;
551
    $cache->clear_from_cache( 'exception_holidays') ;
552
552
Lines 577-583 sub delete_holiday_range { Link Here
577
    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
577
    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
578
578
579
    # changed the 'single_holidays' table, lets force/reset its cache
579
    # changed the 'single_holidays' table, lets force/reset its cache
580
    my $cache = Koha::Cache->get_instance();
580
    my $cache = Koha::Caches->get_instance();
581
    $cache->clear_from_cache( 'single_holidays') ;
581
    $cache->clear_from_cache( 'single_holidays') ;
582
    $cache->clear_from_cache( 'exception_holidays') ;
582
    $cache->clear_from_cache( 'exception_holidays') ;
583
583
Lines 631-637 sub delete_exception_holiday_range { Link Here
631
    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
631
    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
632
632
633
    # changed the 'single_holidays' table, lets force/reset its cache
633
    # changed the 'single_holidays' table, lets force/reset its cache
634
    my $cache = Koha::Cache->get_instance();
634
    my $cache = Koha::Caches->get_instance();
635
    $cache->clear_from_cache( 'single_holidays') ;
635
    $cache->clear_from_cache( 'single_holidays') ;
636
    $cache->clear_from_cache( 'exception_holidays') ;
636
    $cache->clear_from_cache( 'exception_holidays') ;
637
}
637
}
(-)a/C4/Context.pm (-1 / +1 lines)
Lines 511-517 with this method. Link Here
511
511
512
=cut
512
=cut
513
513
514
my $syspref_cache = Koha::Cache->get_instance();
514
my $syspref_cache = Koha::Caches->get_instance();
515
my $use_syspref_cache = 1;
515
my $use_syspref_cache = 1;
516
sub preference {
516
sub preference {
517
    my $self = shift;
517
    my $self = shift;
(-)a/C4/External/OverDrive.pm (-1 / +1 lines)
Lines 99-105 sub GetOverDriveToken { Link Here
99
99
100
    my $cache;
100
    my $cache;
101
101
102
    eval { $cache = Koha::Cache->get_instance() };
102
    eval { $cache = Koha::Caches->get_instance() };
103
103
104
    my $token;
104
    my $token;
105
    $cache and $token = $cache->get_from_cache( "overdrive_token" ) and return $token;
105
    $cache and $token = $cache->get_from_cache( "overdrive_token" ) and return $token;
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 453-459 Returns item record Link Here
453
sub _build_default_values_for_mod_marc {
453
sub _build_default_values_for_mod_marc {
454
    my ($frameworkcode) = @_;
454
    my ($frameworkcode) = @_;
455
455
456
    my $cache     = Koha::Cache->get_instance();
456
    my $cache     = Koha::Caches->get_instance();
457
    my $cache_key = "default_value_for_mod_marc-$frameworkcode";
457
    my $cache_key = "default_value_for_mod_marc-$frameworkcode";
458
    my $cached    = $cache->get_from_cache($cache_key);
458
    my $cached    = $cache->get_from_cache($cache_key);
459
    return $cached if $cached;
459
    return $cached if $cached;
(-)a/C4/Koha.pm (-1 / +1 lines)
Lines 1017-1023 sub GetAuthorisedValues { Link Here
1017
      C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
1017
      C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
1018
    my $cache_key =
1018
    my $cache_key =
1019
      "AuthorisedValues-$category-$opac-$branch_limit";
1019
      "AuthorisedValues-$category-$opac-$branch_limit";
1020
    my $cache  = Koha::Cache->get_instance();
1020
    my $cache  = Koha::Caches->get_instance();
1021
    my $result = $cache->get_from_cache($cache_key);
1021
    my $result = $cache->get_from_cache($cache_key);
1022
    return $result if $result;
1022
    return $result if $result;
1023
1023
(-)a/C4/Utils/DataTables/ColumnsSettings.pm (-1 / +1 lines)
Lines 9-15 use Koha::Cache; Link Here
9
9
10
sub get_yaml {
10
sub get_yaml {
11
    my $yml_path = C4::Context->config('intranetdir') . '/admin/columns_settings.yml';
11
    my $yml_path = C4::Context->config('intranetdir') . '/admin/columns_settings.yml';
12
    my $cache = Koha::Cache->get_instance();
12
    my $cache = Koha::Caches->get_instance();
13
    my $yaml  = $cache->get_from_cache('ColumnsSettingsYaml');
13
    my $yaml  = $cache->get_from_cache('ColumnsSettingsYaml');
14
14
15
    unless ($yaml) {
15
    unless ($yaml) {
(-)a/Koha/Calendar.pm (-2 / +2 lines)
Lines 55-61 sub _init { Link Here
55
sub exception_holidays {
55
sub exception_holidays {
56
    my ( $self ) = @_;
56
    my ( $self ) = @_;
57
57
58
    my $cache  = Koha::Cache->get_instance();
58
    my $cache  = Koha::Caches->get_instance();
59
    my $cached = $cache->get_from_cache('exception_holidays');
59
    my $cached = $cache->get_from_cache('exception_holidays');
60
    return $cached if $cached;
60
    return $cached if $cached;
61
61
Lines 84-90 sub exception_holidays { Link Here
84
sub single_holidays {
84
sub single_holidays {
85
    my ( $self, $date ) = @_;
85
    my ( $self, $date ) = @_;
86
    my $branchcode = $self->{branchcode};
86
    my $branchcode = $self->{branchcode};
87
    my $cache           = Koha::Cache->get_instance();
87
    my $cache           = Koha::Caches->get_instance();
88
    my $single_holidays = $cache->get_from_cache('single_holidays');
88
    my $single_holidays = $cache->get_from_cache('single_holidays');
89
89
90
    # $single_holidays looks like:
90
    # $single_holidays looks like:
(-)a/Koha/Template/Plugin/Cache.pm (-1 / +1 lines)
Lines 35-41 sub new { Link Here
35
    }
35
    }
36
    else {
36
    else {
37
        require Koha::Cache;
37
        require Koha::Cache;
38
        $cache = Koha::Cache->get_instance();
38
        $cache = Koha::Caches->get_instance();
39
    }
39
    }
40
    my $self = bless {
40
    my $self = bless {
41
        CACHE   => $cache,
41
        CACHE   => $cache,
(-)a/admin/biblio_framework.pl (-1 / +1 lines)
Lines 31-37 use Koha::Cache; Link Here
31
my $input         = new CGI;
31
my $input         = new CGI;
32
my $frameworkcode = $input->param('frameworkcode') || q||;
32
my $frameworkcode = $input->param('frameworkcode') || q||;
33
my $op            = $input->param('op') || q|list|;
33
my $op            = $input->param('op') || q|list|;
34
my $cache         = Koha::Cache->get_instance();
34
my $cache         = Koha::Caches->get_instance();
35
my @messages;
35
my @messages;
36
36
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
(-)a/admin/koha2marclinks.pl (-1 / +1 lines)
Lines 59-65 else { Link Here
59
}
59
}
60
60
61
my $dbh = C4::Context->dbh;
61
my $dbh = C4::Context->dbh;
62
my $cache = Koha::Cache->get_instance();
62
my $cache = Koha::Caches->get_instance();
63
63
64
################## ADD_FORM ##################################
64
################## ADD_FORM ##################################
65
# called by default. Used to create form to add or  modify a record
65
# called by default. Used to create form to add or  modify a record
(-)a/admin/marc_subfields_structure.pl (-1 / +1 lines)
Lines 77-83 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
77
        debug           => 1,
77
        debug           => 1,
78
    }
78
    }
79
);
79
);
80
my $cache = Koha::Cache->get_instance();
80
my $cache = Koha::Caches->get_instance();
81
81
82
my $op       = $input->param('op') || "";
82
my $op       = $input->param('op') || "";
83
$tagfield =~ s/\,//g;
83
$tagfield =~ s/\,//g;
(-)a/admin/marctagstructure.pl (-1 / +1 lines)
Lines 46-52 my $pagesize = 20; Link Here
46
my $script_name = "/cgi-bin/koha/admin/marctagstructure.pl";
46
my $script_name = "/cgi-bin/koha/admin/marctagstructure.pl";
47
47
48
my $dbh = C4::Context->dbh;
48
my $dbh = C4::Context->dbh;
49
my $cache = Koha::Cache->get_instance();
49
my $cache = Koha::Caches->get_instance();
50
50
51
# open template
51
# open template
52
my ($template, $loggedinuser, $cookie)
52
my ($template, $loggedinuser, $cookie)
(-)a/opac/svc/report (-1 / +1 lines)
Lines 41-47 die "Sorry this report is not public\n" unless $report_rec->{public}; Link Here
41
41
42
my @sql_params  = $query->param('sql_params');
42
my @sql_params  = $query->param('sql_params');
43
43
44
my $cache = Koha::Cache->get_instance();
44
my $cache = Koha::Caches->get_instance();
45
my $cache_active = $cache->is_cache_active;
45
my $cache_active = $cache->is_cache_active;
46
my ($cache_key, $json_text);
46
my ($cache_key, $json_text);
47
if ($cache_active) {
47
if ($cache_active) {
(-)a/svc/report (-1 / +1 lines)
Lines 48-54 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
48
    }
48
    }
49
);
49
);
50
50
51
my $cache = Koha::Cache->get_instance();
51
my $cache = Koha::Caches->get_instance();
52
my $cache_active = $cache->is_cache_active;
52
my $cache_active = $cache->is_cache_active;
53
my ($cache_key, $json_text);
53
my ($cache_key, $json_text);
54
if ($cache_active) {
54
if ($cache_active) {
(-)a/t/Calendar.t (-1 / +1 lines)
Lines 89-95 fixtures_ok [ Link Here
89
      ],
89
      ],
90
], "add fixtures";
90
], "add fixtures";
91
91
92
my $cache = Koha::Cache->get_instance();
92
my $cache = Koha::Caches->get_instance();
93
$cache->clear_from_cache( 'single_holidays') ;
93
$cache->clear_from_cache( 'single_holidays') ;
94
94
95
# 'MPL' branch is arbitrary, is not used at all but is needed for initialization
95
# 'MPL' branch is arbitrary, is not used at all but is needed for initialization
(-)a/t/db_dependent/Filter_MARC_ViewPolicy.t (-1 / +1 lines)
Lines 71-77 sub run_hiding_tests { Link Here
71
71
72
        $sth->execute($hidden_value);
72
        $sth->execute($hidden_value);
73
73
74
        my $cache = Koha::Cache->get_instance();
74
        my $cache = Koha::Caches->get_instance();
75
        $cache->flush_all();    # easy way to ensure DB is queried again.
75
        $cache->flush_all();    # easy way to ensure DB is queried again.
76
76
77
        my $processor = Koha::RecordProcessor->new(
77
        my $processor = Koha::RecordProcessor->new(
(-)a/t/db_dependent/Items.t (-2 / +2 lines)
Lines 380-386 subtest 'SearchItems test' => sub { Link Here
380
    $dbh->do('INSERT INTO marc_subfield_structure (tagfield, tagsubfield, frameworkcode) VALUES (?, "z", ?)', undef, $itemfield, $frameworkcode);
380
    $dbh->do('INSERT INTO marc_subfield_structure (tagfield, tagsubfield, frameworkcode) VALUES (?, "z", ?)', undef, $itemfield, $frameworkcode);
381
381
382
    # Clear cache
382
    # Clear cache
383
    my $cache = Koha::Cache->get_instance();
383
    my $cache = Koha::Caches->get_instance();
384
    $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
384
    $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
385
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
385
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
386
    $cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode");
386
    $cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode");
Lines 644-650 subtest 'C4::Items::_build_default_values_for_mod_marc' => sub { Link Here
644
    |, undef, $framework->{frameworkcode} );
644
    |, undef, $framework->{frameworkcode} );
645
645
646
    # And make sure the caches are cleared
646
    # And make sure the caches are cleared
647
    my $cache = Koha::Cache->get_instance();
647
    my $cache = Koha::Caches->get_instance();
648
    $cache->clear_from_cache("MarcStructure-0-" . $framework->{frameworkcode});
648
    $cache->clear_from_cache("MarcStructure-0-" . $framework->{frameworkcode});
649
    $cache->clear_from_cache("MarcStructure-1-" . $framework->{frameworkcode});
649
    $cache->clear_from_cache("MarcStructure-1-" . $framework->{frameworkcode});
650
    $cache->clear_from_cache("default_value_for_mod_marc-" . $framework->{frameworkcode});
650
    $cache->clear_from_cache("default_value_for_mod_marc-" . $framework->{frameworkcode});
(-)a/tools/newHolidays.pl (-2 / +1 lines)
Lines 129-134 sub add_holiday { Link Here
129
        }
129
        }
130
    }
130
    }
131
    # we updated the single_holidays table, so wipe its cache
131
    # we updated the single_holidays table, so wipe its cache
132
    my $cache = Koha::Cache->get_instance();
132
    my $cache = Koha::Caches->get_instance();
133
    $cache->clear_from_cache( 'single_holidays') ;
133
    $cache->clear_from_cache( 'single_holidays') ;
134
}
134
}
135
- 

Return to bug 17189