summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMary Umoh <umohm12@gmail.com>2017-07-06 02:42:01 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-07 00:19:34 +0200
commit616831b6c6d05283cef53211d4cf6800c20325e7 (patch)
treedfd7ce2c990dcb18add29c9d61d43c565ef8db60
parent6f06744ccc95232300ee53ead82166e60c84351c (diff)
downloadbugzilla-616831b6c6d05283cef53211d4cf6800c20325e7.tar.gz
bugzilla-616831b6c6d05283cef53211d4cf6800c20325e7.tar.xz
Bug 1377807 - Move memcached options from data/params to localconfig
-rw-r--r--Bugzilla/Config/Memcached.pm33
-rw-r--r--Bugzilla/Install/Localconfig.pm16
-rw-r--r--Bugzilla/Memcached.pm5
-rw-r--r--docs/en/rst/administering/parameters.rst16
-rw-r--r--template/en/default/admin/params/memcached.html.tmpl22
-rw-r--r--template/en/default/setup/strings.txt.pl8
6 files changed, 27 insertions, 73 deletions
diff --git a/Bugzilla/Config/Memcached.pm b/Bugzilla/Config/Memcached.pm
deleted file mode 100644
index 292803d86..000000000
--- a/Bugzilla/Config/Memcached.pm
+++ /dev/null
@@ -1,33 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Config::Memcached;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use Bugzilla::Config::Common;
-
-our $sortkey = 1550;
-
-sub get_param_list {
- return (
- {
- name => 'memcached_servers',
- type => 't',
- default => ''
- },
- {
- name => 'memcached_namespace',
- type => 't',
- default => 'bugzilla:',
- },
- );
-}
-
-1;
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm
index a366353bc..4fb15a1c2 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -43,6 +43,14 @@ sub _sensible_group {
return scalar getgrgid($EGID);
}
+sub _migrate_param {
+ my ($name, $fallback_value) = @_;
+
+ return sub {
+ return Bugzilla->params->{$name} // $fallback_value;
+ };
+}
+
use constant LOCALCONFIG_VARS => (
{
name => 'create_htaccess',
@@ -126,6 +134,14 @@ use constant LOCALCONFIG_VARS => (
name => 'apache_size_limit',
default => 600000,
},
+ {
+ name => 'memcached_servers',
+ default => _migrate_param("memcached_servers", ""),
+ },
+ {
+ name => 'memcached_namespace',
+ default => _migrate_param("memcached_namespace", "bugzilla:"),
+ },
);
sub read_localconfig {
diff --git a/Bugzilla/Memcached.pm b/Bugzilla/Memcached.pm
index 37b158ad5..233db31f2 100644
--- a/Bugzilla/Memcached.pm
+++ b/Bugzilla/Memcached.pm
@@ -30,9 +30,9 @@ sub _new {
# always return an object to simplify calling code when memcached is
# disabled.
- my $servers = Bugzilla->get_param_with_override('memcached_servers');
+ my $servers = Bugzilla->localconfig->{memcached_servers};
if (Bugzilla->feature('memcached') && $servers) {
- $self->{namespace} = Bugzilla->get_param_with_override('memcached_namespace');
+ $self->{namespace} = Bugzilla->localconfig->{memcached_namespace};
$self->{memcached} = Cache::Memcached::Fast->new({
servers => [ split(/[, ]+/, $servers) ],
namespace => $self->{namespace},
@@ -462,4 +462,3 @@ Memcached that it then clears the cache:
$dbh->do("UPDATE profiles SET last_activity_ts=? WHERE userid=?",
undef, $timestamp, $user_id);
Bugzilla->memcached->clear({ table => 'profiles', id => $user_id });
-
diff --git a/docs/en/rst/administering/parameters.rst b/docs/en/rst/administering/parameters.rst
index 0e7829051..1452a9fb9 100644
--- a/docs/en/rst/administering/parameters.rst
+++ b/docs/en/rst/administering/parameters.rst
@@ -371,7 +371,7 @@ font_file
TrueType font such as Unifont which supports all printable characters in
the Basic Multilingual Plane. If you leave this parameter empty, a default
font will be used, but its support is limited to English characters only
- and so other characters will be displayed incorrectly.
+ and so other characters will be displayed incorrectly.
.. _param-group-security:
@@ -717,20 +717,6 @@ shadowdbsock
shadowdb
The database name of the shadow database.
-.. _admin-memcached:
-
-Memcached
-=========
-
-memcached_servers
- If this option is set, Bugzilla will integrate with `Memcached
- <http://www.memcached.org/>`_. Specify one or more servers, separated by
- spaces, using hostname:port notation (for example:
- :paramval:`127.0.0.1:11211`).
-
-memcached_namespace
- Specify a string to prefix each key on Memcached.
-
.. _admin-usermatching:
User Matching
diff --git a/template/en/default/admin/params/memcached.html.tmpl b/template/en/default/admin/params/memcached.html.tmpl
deleted file mode 100644
index eef39860a..000000000
--- a/template/en/default/admin/params/memcached.html.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
- # License, v. 2.0. If a copy of the MPL was not distributed with this
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
- #
- # This Source Code Form is "Incompatible With Secondary Licenses", as
- # defined by the Mozilla Public License, v. 2.0.
- #%]
-[%
- title = "Memcached"
- desc = "Set up Memcached integration"
-%]
-
-[% param_descs = {
- memcached_servers =>
- "If this option is set, $terms.Bugzilla will integrate with Memcached. " _
- "Specify one of more server, separated by spaces, using hostname:port " _
- "notation (for example: 127.0.0.1:11211).",
-
- memcached_namespace =>
- "Specify a string to prefix to each key on Memcached.",
- }
-%]
diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl
index 8afb4a2e4..2e1a18f00 100644
--- a/template/en/default/setup/strings.txt.pl
+++ b/template/en/default/setup/strings.txt.pl
@@ -178,6 +178,14 @@ If you want to use the "Difference Between Two Patches" feature of the
Patch Viewer, please specify the full path to the "interdiff" executable
here.
END
+ localconfig_memcached_servers => <<'END',
+If this option is set, Bugzilla will integrate with Memcached.
+Specify one or more servers, separated by spaces, using hostname:port
+notation (for example: 127.0.0.1:11211).
+END
+ localconfig_memcached_namespace => <<'END',
+Specify a string to prefix each key on Memcached.
+END
localconfig_site_wide_secret => <<'END',
This secret key is used by your installation for the creation and
validation of encrypted tokens. These tokens are used to implement