summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Config/Memcached.pm33
-rw-r--r--Bugzilla/Install/Localconfig.pm16
-rw-r--r--Bugzilla/Memcached.pm5
3 files changed, 18 insertions, 36 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 });
-