Bugzilla – Attachment 55329 Details for
Bug 17274
Add info about which memcached config is used to about.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17274: Display the place where the memcached is picked
Bug-17274-Display-the-place-where-the-memcached-is.patch (text/plain), 3.87 KB, created by
Jonathan Druart
on 2016-09-08 09:29:12 UTC
(
hide
)
Description:
Bug 17274: Display the place where the memcached is picked
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-08 09:29:12 UTC
Size:
3.87 KB
patch
obsolete
>From 4370d3fa1c409059e8e5c584ec0d57632c7105fb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Sep 2016 10:26:34 +0100 >Subject: [PATCH] Bug 17274: Display the place where the memcached is picked > >The memcached config can be read from ENV or koha-conf.xml >In order to remove any ambiguity, let's inform the user which config is >used. > >Test plan: >1/ Define the memcached config in ENV and $KOHA_CONF >=> Go on about page, you should get a warning >2/ Define the memcached config in ENV and not in $KOHA_CONF >=> Go on about page, you should get a warning >3/ Do not defined the memcached config in ENV or $KOHA_CONF >=> Go on about page, you should get a warning >4/ Define the memcached config in $KOHA_CONF and not in ENV >=> Go on about page, you should not get a warning, this is the expected >config >--- > about.pl | 12 +++++++++++- > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 13 ++++++++++++- > 2 files changed, 23 insertions(+), 2 deletions(-) > >diff --git a/about.pl b/about.pl >index 3e1240b..fc16079 100755 >--- a/about.pl >+++ b/about.pl >@@ -81,12 +81,22 @@ my $effective_caching_method = ref($cache->cache); > # FIXME What are the consequences of that?? > my $is_memcached_still_active = $cache->set_in_cache('test_for_about_page', "just a simple value"); > >+my $where_is_memcached_config = 'nowhere'; >+if ( $ENV{MEMCACHED_SERVERS} and C4::Context->config('memcached_servers') ) { >+ $where_is_memcached_config = 'both'; >+} elsif ( $ENV{MEMCACHED_SERVERS} and not C4::Context->config('memcached_servers') ) { >+ $where_is_memcached_config = 'ENV_only'; >+} elsif ( C4::Context->config('memcached_servers') ) { >+ $where_is_memcached_config = 'config_only'; >+} >+ > $template->param( > effective_caching_method => $effective_caching_method, > memcached_servers => $memcached_servers, > memcached_namespace => $memcached_namespace, > is_memcached_still_active => $is_memcached_still_active, >- memcached_running => Koha::Caches->get_instance->memcached_cache >+ where_is_memcached_config => $where_is_memcached_config, >+ memcached_running => Koha::Caches->get_instance->memcached_cache, > ); > > # Additional system information for warnings >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 3fa3f4e..ea84e42 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -69,7 +69,18 @@ > [% END %] > [% ELSE %] > <span>unknown</span> >- [% END %] >+ [% END %] | >+ Config read from: >+ [% SWITCH where_is_memcached_config %] >+ [% CASE 'config_only' %] >+ <span class="status_ok">koha-conf.xml</span> >+ [% CASE 'ENV_only' %] >+ <span class="status_warn">ENV</span> Note that the right place to define the memcached config is in your $KOHA_CONF file >+ [% CASE 'both' %] >+ <span class="status_warn">ENV and koha-conf.xml</span> Note that the right place to define the memcached config is in your $KOHA_CONF file. To avoid any misunderstanding you whould not export the memcached config from ENV. >+ [% CASE # nowhere %] >+ <span class="status_warn">Nowhere</span> Note that the right place to define the memcached config is in your $KOHA_CONF file. Currently you do not have a valid memcached configuration defined. >+ [% END %] > [% IF effective_caching_method != 'Cache::Memcached::Fast' %] > | Effective caching method: [% effective_caching_method %] > [% END %] >-- >2.8.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 17274
:
55329
|
55479
|
57056