diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2016-03-11 18:58:51 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2016-03-11 18:58:51 +0100 |
commit | 53d6ba4398b0e27216d5152dea3fbe0a9f0e1572 (patch) | |
tree | 891885b89357baaa20ba0efd9c0ab323bee265de | |
parent | 777c785af2f2e8ee911298d98649626ee346aa39 (diff) | |
download | bugzilla-53d6ba4398b0e27216d5152dea3fbe0a9f0e1572.tar.gz bugzilla-53d6ba4398b0e27216d5152dea3fbe0a9f0e1572.tar.xz |
Back out bug 1251208: it makes checksetup.pl to never end and localconfig is erased
-rw-r--r-- | Bugzilla.pm | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index bff8dc788..8bea97b39 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -682,21 +682,43 @@ sub local_timezone { ||= DateTime::TimeZone->new(name => 'local'); } -my $request_cache = {}; - -sub request_cache { return $request_cache } +# This creates the request cache for non-mod_perl installations. +# This is identical to Install::Util::_cache so that things loaded +# into Install::Util::_cache during installation can be read out +# of request_cache later in installation. +our $_request_cache = $Bugzilla::Install::Util::_cache; + +sub request_cache { + if ($ENV{MOD_PERL}) { + require Apache2::RequestUtil; + # Sometimes (for example, during mod_perl.pl), the request + # object isn't available, and we should use $_request_cache instead. + my $request = eval { Apache2::RequestUtil->request }; + return $_request_cache if !$request; + return $request->pnotes(); + } + return $_request_cache; +} sub clear_request_cache { - %$request_cache = (); + $_request_cache = {}; + if ($ENV{MOD_PERL}) { + require Apache2::RequestUtil; + my $request = eval { Apache2::RequestUtil->request }; + if ($request) { + my $pnotes = $request->pnotes; + delete @$pnotes{(keys %$pnotes)}; + } + } } # 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. -my $process_cache = {}; +our $_process_cache = {}; sub process_cache { - return $process_cache; + return $_process_cache; } # This is a memcached wrapper, which provides cross-process and cross-system |