summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Constants.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-11-22 17:42:24 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-11-22 17:42:24 +0100
commitb2cbd18450de1ff8fc74f0283bc20f2bbcdf7462 (patch)
tree3c06b3dbadea8b38e557784b95ffc9d7871b0624 /Bugzilla/Constants.pm
parent48f1c7dd3b0dbec024b973f590759178b7a42d0c (diff)
parentc6528d5819e6503c6772a3a8a17029cb892519b0 (diff)
downloadbugzilla-b2cbd18450de1ff8fc74f0283bc20f2bbcdf7462.tar.gz
bugzilla-b2cbd18450de1ff8fc74f0283bc20f2bbcdf7462.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/Constants.pm')
-rw-r--r--Bugzilla/Constants.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index e13a93388..b4262f8ab 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -614,6 +614,13 @@ use constant AUDIT_CREATE => '__create__';
use constant AUDIT_REMOVE => '__remove__';
sub bz_locations {
+ # Force memoize() to re-compute data per project, to avoid
+ # sharing the same data across different installations.
+ return _bz_locations($ENV{'PROJECT'});
+}
+
+sub _bz_locations {
+ my $project = shift;
# We know that Bugzilla/Constants.pm must be in %INC at this point.
# So the only question is, what's the name of the directory
# above it? This is the most reliable way to get our current working
@@ -630,12 +637,13 @@ sub bz_locations {
$libpath =~ /(.*)/;
$libpath = $1;
- my ($project, $localconfig, $datadir);
- if ($ENV{'PROJECT'} && $ENV{'PROJECT'} =~ /^(\w+)$/) {
+ my ($localconfig, $datadir);
+ if ($project && $project =~ /^(\w+)$/) {
$project = $1;
$localconfig = "localconfig.$project";
$datadir = "data/$project";
} else {
+ $project = undef;
$localconfig = "localconfig";
$datadir = "data";
}
@@ -670,6 +678,6 @@ sub bz_locations {
# This makes us not re-compute all the bz_locations data every time it's
# called.
-BEGIN { memoize('bz_locations') };
+BEGIN { memoize('_bz_locations') };
1;