From f7d1f7b803a9e89be4407d102a48eddd1708e103 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Fri, 5 Oct 2012 00:49:53 +0800 Subject: Bug 797883: Adds a Bugzilla->process_cache r=LpSolit, a=LpSolit --- Bugzilla.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index f956f5a0e..6c86fb0fc 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -271,8 +271,7 @@ sub input_params { our $_localconfig; sub localconfig { - $_localconfig ||= read_localconfig(); - return $_localconfig; + return $_[0]->process_cache->{localconfig} ||= read_localconfig(); } sub params { @@ -643,6 +642,15 @@ sub request_cache { return $_request_cache; } +# This is a per-process cache. Under mod_cgi it's identical to the +# request_cache. When using mod_perl, items in this cache live until the +# worker process is terminated. +our $_process_cache = {}; + +sub process_cache { + return $_process_cache; +} + # Private methods # Per-process cleanup. Note that this is a plain subroutine, not a method, -- cgit v1.2.3-24-g4f1b