Bugzilla – Attachment 51577 Details for
Bug 16520
Per-virtualhost SetEnvs don't work with Plack
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16520: Initialize the sysprefs Koha::Cache on demand
Bug-16520-Initialize-the-sysprefs-KohaCache-on-dem.patch (text/plain), 1.47 KB, created by
Tomás Cohen Arazi
on 2016-05-17 16:00:04 UTC
(
hide
)
Description:
Bug 16520: Initialize the sysprefs Koha::Cache on demand
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2016-05-17 16:00:04 UTC
Size:
1.47 KB
patch
obsolete
>From eb2335a8039346d844375017e49e27cae3f1f280 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <jweaver@bywatersolutions.com> >Date: Fri, 13 May 2016 16:39:08 -0600 >Subject: [PATCH] Bug 16520: Initialize the sysprefs Koha::Cache on demand > >This is needed so that the cache singleton doesn't get created before >the MEMCACHED_* environment variables are set. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Context.pm | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index c80647a..8f043ce 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -512,21 +512,22 @@ with this method. > > =cut > >-my $syspref_cache = Koha::Cache->get_instance(); >+my $syspref_cache; > my $use_syspref_cache = 1; > sub preference { > my $self = shift; > my $var = shift; # The system preference to return > >- $var = lc $var; >- > return $ENV{"OVERRIDE_SYSPREF_$var"} > if defined $ENV{"OVERRIDE_SYSPREF_$var"}; > >- my $cached_var = $use_syspref_cache >- ? $syspref_cache->get_from_cache("syspref_$var") >- : undef; >- return $cached_var if defined $cached_var; >+ $var = lc $var; >+ >+ if ($use_syspref_cache) { >+ $syspref_cache = Koha::Cache->get_instance() unless $syspref_cache; >+ my $cached_var = $syspref_cache->get_from_cache("syspref_$var"); >+ return $cached_var if defined $cached_var; >+ } > > my $syspref; > eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) }; >-- >2.7.4
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 16520
:
51493
|
51494
|
51495
|
51496
|
51576
|
51577
|
51578
|
51579
|
51580
|
56309
|
56310
|
56311
|
56312
|
56397
|
56410
|
56411
|
56412
|
56413
|
57372
|
57383