]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1377807 - Move memcached options from data/params to localconfig
authorMary Umoh <umohm12@gmail.com>
Thu, 6 Jul 2017 00:42:01 +0000 (20:42 -0400)
committerDylan William Hardison <dylan@hardison.net>
Thu, 6 Jul 2017 22:19:34 +0000 (18:19 -0400)
Bugzilla/Config/Memcached.pm [deleted file]
Bugzilla/Install/Localconfig.pm
Bugzilla/Memcached.pm
docs/en/rst/administering/parameters.rst
template/en/default/admin/params/memcached.html.tmpl [deleted file]
template/en/default/setup/strings.txt.pl

diff --git a/Bugzilla/Config/Memcached.pm b/Bugzilla/Config/Memcached.pm
deleted file mode 100644 (file)
index 292803d..0000000
+++ /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;
index a366353bcf0c9ae8b79f96dfd225d7ed8ab65fe9..4fb15a1c29b9d90a02ae286544a145ff6ed07c05 100644 (file)
@@ -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 {
index 37b158ad54c58e43a0dccf5d30b1fdab7d568777..233db31f273107a284b516fc53cd350cf53a0795 100644 (file)
@@ -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 });
-
index 0e7829051ed0f9537ccd89825a4c991d349a217d..1452a9fb9ffd2ceceea12a3913a89aecaeb1bc81 100644 (file)
@@ -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 (file)
index eef3986..0000000
+++ /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.",
-  }
-%]
index 8afb4a2e4dad64fa159a915897d1708009047758..2e1a18f004d23ab1c36357c67d3dedaf44da9fb5 100644 (file)
@@ -177,6 +177,14 @@ END
 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