Bugzilla – Attachment 135918 Details for
Bug 29623
Cache effective circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite
Bug-29623-QA-follow-up-Add-POD-to-KohaCacheLite.patch (text/plain), 2.11 KB, created by
Martin Renvoize
on 2022-06-10 07:22:28 UTC
(
hide
)
Description:
Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-06-10 07:22:28 UTC
Size:
2.11 KB
patch
obsolete
>From 02c8f00365b1765a0d908277cb191976b7bc0190 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 Jun 2022 08:11:28 +0100 >Subject: [PATCH] Bug 29623: (QA follow-up) Add POD to Koha::Cache::Lite > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Cache/Memory/Lite.pm | 52 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 51 insertions(+), 1 deletion(-) > >diff --git a/Koha/Cache/Memory/Lite.pm b/Koha/Cache/Memory/Lite.pm >index 21c6b121d7..ebdb0431d4 100644 >--- a/Koha/Cache/Memory/Lite.pm >+++ b/Koha/Cache/Memory/Lite.pm >@@ -41,34 +41,84 @@ use Modern::Perl; > use base qw(Class::Accessor); > > our %L1_cache; >- > our $singleton_cache; >+ >+=head2 get_instance >+ >+This gets a shared instance of the lite cache, set up in a very default >+way. The lite cache is an in memory only cache that's automatically flushed >+for every request. >+ >+=cut >+ > sub get_instance { > my ($class) = @_; > $singleton_cache = $class->new() unless $singleton_cache; > return $singleton_cache; > } > >+=head2 get_from_cache >+ >+ my $value = $cache->get_from_cache($key); >+ >+Retrieve the value stored under the specified key in the cache. >+ >+The retrieved value is a direct reference so should not be modified. >+ >+=cut >+ > sub get_from_cache { > my ( $self, $key ) = @_; > return $L1_cache{$key}; > } > >+=head2 set_in_cache >+ >+ $cache->set_in_cache($key, $value); >+ >+Save a value to the specified key in the cache. >+ >+=cut >+ > sub set_in_cache { > my ( $self, $key, $value ) = @_; > $L1_cache{$key} = $value; > } > >+=head2 clear_from_cache >+ >+ $cache->clear_from_cache($key); >+ >+Remove the value identified by the specified key from the lite cache. >+ >+=cut >+ > sub clear_from_cache { > my ( $self, $key ) = @_; > delete $L1_cache{$key}; > } > >+=head2 all_keys >+ >+ my @keys = $cache->all_keys(); >+ >+Returns an array of all keys currently in the lite cache. >+ >+=cut >+ > sub all_keys { > my ( $self ) = @_; > return keys %L1_cache; > } > >+=head2 flush >+ >+ $cache->flush(); >+ >+Clear the entire lite cache. >+ >+=cut >+ > sub flush { > my ( $self ) = @_; > %L1_cache = (); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29623
:
128180
|
128576
|
134209
|
135463
|
135916
|
135917
| 135918 |
135919