Bug 17189: Add the ability to define several memcached namespaces - replace existing...
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 22 Jun 2016 15:02:08 +0000 (16:02 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Thu, 8 Sep 2016 10:24:46 +0000 (10:24 +0000)
s/Koha::Cache->get_instance/Koha::Caches->get_instance

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

19 files changed:
C4/Biblio.pm
C4/Calendar.pm
C4/Context.pm
C4/External/OverDrive.pm
C4/Items.pm
C4/Koha.pm
C4/Utils/DataTables/ColumnsSettings.pm
Koha/Calendar.pm
Koha/Template/Plugin/Cache.pm
admin/biblio_framework.pl
admin/koha2marclinks.pl
admin/marc_subfields_structure.pl
admin/marctagstructure.pl
opac/svc/report
svc/report
t/Calendar.t
t/db_dependent/Filter_MARC_ViewPolicy.t
t/db_dependent/Items.t
tools/newHolidays.pl

index 3a34d79..8865daa 100644 (file)
@@ -1122,7 +1122,7 @@ sub GetMarcStructure {
     $frameworkcode = "" unless $frameworkcode;
 
     $forlibrarian = $forlibrarian ? 1 : 0;
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     my $cache_key = "MarcStructure-$forlibrarian-$frameworkcode";
     my $cached = $cache->get_from_cache($cache_key);
     return $cached if $cached;
@@ -1230,7 +1230,7 @@ sub GetMarcSubfieldStructure {
 
     $frameworkcode //= '';
 
-    my $cache     = Koha::Cache->get_instance();
+    my $cache     = Koha::Caches->get_instance();
     my $cache_key = "MarcSubfieldStructure-$frameworkcode";
     my $cached    = $cache->get_from_cache($cache_key);
     return $cached if $cached;
index 82dc35a..18a23ab 100644 (file)
@@ -276,7 +276,7 @@ sub insert_single_holiday {
 
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -321,7 +321,7 @@ sub insert_exception_holiday {
     $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -422,7 +422,7 @@ UPDATE special_holidays SET title = ?, description = ?
     $self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -465,7 +465,7 @@ UPDATE special_holidays SET title = ?, description = ?
     $self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description};
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -546,7 +546,7 @@ sub delete_holiday {
     }
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -577,7 +577,7 @@ sub delete_holiday_range {
     $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 
@@ -631,7 +631,7 @@ sub delete_exception_holiday_range {
     $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
 
     # changed the 'single_holidays' table, lets force/reset its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
     $cache->clear_from_cache( 'exception_holidays') ;
 }
index baed482..cb3c966 100644 (file)
@@ -511,7 +511,7 @@ with this method.
 
 =cut
 
-my $syspref_cache = Koha::Cache->get_instance();
+my $syspref_cache = Koha::Caches->get_instance();
 my $use_syspref_cache = 1;
 sub preference {
     my $self = shift;
index 12135c5..1093a1b 100644 (file)
@@ -99,7 +99,7 @@ sub GetOverDriveToken {
 
     my $cache;
 
-    eval { $cache = Koha::Cache->get_instance() };
+    eval { $cache = Koha::Caches->get_instance() };
 
     my $token;
     $cache and $token = $cache->get_from_cache( "overdrive_token" ) and return $token;
index 41bd03a..dd7614c 100644 (file)
@@ -454,7 +454,7 @@ Returns item record
 sub _build_default_values_for_mod_marc {
     my ($frameworkcode) = @_;
 
-    my $cache     = Koha::Cache->get_instance();
+    my $cache     = Koha::Caches->get_instance();
     my $cache_key = "default_value_for_mod_marc-$frameworkcode";
     my $cached    = $cache->get_from_cache($cache_key);
     return $cached if $cached;
index bb35811..d82ad1e 100644 (file)
@@ -1017,7 +1017,7 @@ sub GetAuthorisedValues {
       C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
     my $cache_key =
       "AuthorisedValues-$category-$opac-$branch_limit";
-    my $cache  = Koha::Cache->get_instance();
+    my $cache  = Koha::Caches->get_instance();
     my $result = $cache->get_from_cache($cache_key);
     return $result if $result;
 
index a107886..9e838d6 100644 (file)
@@ -9,7 +9,7 @@ use Koha::Cache;
 
 sub get_yaml {
     my $yml_path = C4::Context->config('intranetdir') . '/admin/columns_settings.yml';
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     my $yaml  = $cache->get_from_cache('ColumnsSettingsYaml');
 
     unless ($yaml) {
index 1321621..4b48ae2 100644 (file)
@@ -55,7 +55,7 @@ sub _init {
 sub exception_holidays {
     my ( $self ) = @_;
 
-    my $cache  = Koha::Cache->get_instance();
+    my $cache  = Koha::Caches->get_instance();
     my $cached = $cache->get_from_cache('exception_holidays');
     return $cached if $cached;
 
@@ -84,7 +84,7 @@ sub exception_holidays {
 sub single_holidays {
     my ( $self, $date ) = @_;
     my $branchcode = $self->{branchcode};
-    my $cache           = Koha::Cache->get_instance();
+    my $cache           = Koha::Caches->get_instance();
     my $single_holidays = $cache->get_from_cache('single_holidays');
 
     # $single_holidays looks like:
index dbb1c82..5e3f8f7 100644 (file)
@@ -35,7 +35,7 @@ sub new {
     }
     else {
         require Koha::Cache;
-        $cache = Koha::Cache->get_instance();
+        $cache = Koha::Caches->get_instance();
     }
     my $self = bless {
         CACHE   => $cache,
index 3aeb0ca..57839b9 100755 (executable)
@@ -31,7 +31,7 @@ use Koha::Cache;
 my $input         = new CGI;
 my $frameworkcode = $input->param('frameworkcode') || q||;
 my $op            = $input->param('op') || q|list|;
-my $cache         = Koha::Cache->get_instance();
+my $cache         = Koha::Caches->get_instance();
 my @messages;
 
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
index 9ccca37..d8fd569 100755 (executable)
@@ -59,7 +59,7 @@ else {
 }
 
 my $dbh = C4::Context->dbh;
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 
 ################## ADD_FORM ##################################
 # called by default. Used to create form to add or  modify a record
index 096b9ec..ea1373e 100755 (executable)
@@ -77,7 +77,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         debug           => 1,
     }
 );
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 
 my $op       = $input->param('op') || "";
 $tagfield =~ s/\,//g;
index 2b4f2a1..3ea47ed 100755 (executable)
@@ -46,7 +46,7 @@ my $pagesize = 20;
 my $script_name = "/cgi-bin/koha/admin/marctagstructure.pl";
 
 my $dbh = C4::Context->dbh;
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 
 # open template
 my ($template, $loggedinuser, $cookie)
index bfc84e5..9cc21a3 100755 (executable)
@@ -41,7 +41,7 @@ die "Sorry this report is not public\n" unless $report_rec->{public};
 
 my @sql_params  = $query->param('sql_params');
 
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 my $cache_active = $cache->is_cache_active;
 my ($cache_key, $json_text);
 if ($cache_active) {
index da1b9b3..c7e4053 100755 (executable)
@@ -48,7 +48,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 my $cache_active = $cache->is_cache_active;
 my ($cache_key, $json_text);
 if ($cache_active) {
index 4d48c02..7563753 100755 (executable)
@@ -89,7 +89,7 @@ fixtures_ok [
       ],
 ], "add fixtures";
 
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 $cache->clear_from_cache( 'single_holidays') ;
 
 # 'MPL' branch is arbitrary, is not used at all but is needed for initialization
index ba446bc..709aea9 100644 (file)
@@ -71,7 +71,7 @@ sub run_hiding_tests {
 
         $sth->execute($hidden_value);
 
-        my $cache = Koha::Cache->get_instance();
+        my $cache = Koha::Caches->get_instance();
         $cache->flush_all();    # easy way to ensure DB is queried again.
 
         my $processor = Koha::RecordProcessor->new(
index b494a70..3e886e2 100755 (executable)
@@ -380,7 +380,7 @@ subtest 'SearchItems test' => sub {
     $dbh->do('INSERT INTO marc_subfield_structure (tagfield, tagsubfield, frameworkcode) VALUES (?, "z", ?)', undef, $itemfield, $frameworkcode);
 
     # Clear cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
     $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
     $cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode");
@@ -644,7 +644,7 @@ subtest 'C4::Items::_build_default_values_for_mod_marc' => sub {
     |, undef, $framework->{frameworkcode} );
 
     # And make sure the caches are cleared
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache("MarcStructure-0-" . $framework->{frameworkcode});
     $cache->clear_from_cache("MarcStructure-1-" . $framework->{frameworkcode});
     $cache->clear_from_cache("default_value_for_mod_marc-" . $framework->{frameworkcode});
index eda4c1b..f36f0e0 100755 (executable)
@@ -129,6 +129,6 @@ sub add_holiday {
         }
     }
     # we updated the single_holidays table, so wipe its cache
-    my $cache = Koha::Cache->get_instance();
+    my $cache = Koha::Caches->get_instance();
     $cache->clear_from_cache( 'single_holidays') ;
 }