From d8df1674801ce2392cfdd78114c5a4f6eb96f840 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 16 Sep 2005 05:16:51 +0000 Subject: Bug 282686: Multiple projects sharing the same Bugzilla codebase (different datastores) - Patch by guillomovitch@zarb.org r=wurblzap a=justdave --- Bugzilla/Config.pm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'Bugzilla/Config.pm') diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index c124d62bd..5ebc74e52 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -50,11 +50,23 @@ use base qw(Exporter); # graphs (since the path will be wrong in the HTML). This will be fixed at # some point. +# constant paths our $libpath = '.'; -our $localconfig = "$libpath/localconfig"; -our $datadir = "$libpath/data"; -our $attachdir = "$datadir/attachments"; our $templatedir = "$libpath/template"; + +# variable paths +our $project; +our $localconfig; +our $datadir; +if ($ENV{'PROJECT'} && $ENV{'PROJECT'} =~ /^(\w+)$/) { + $project = $1; + $localconfig = "$libpath/localconfig.$project"; + $datadir = "$libpath/data/$project"; +} else { + $localconfig = "$libpath/localconfig"; + $datadir = "$libpath/data"; +} +our $attachdir = "$datadir/attachments"; our $webdotdir = "$datadir/webdot"; # Module stuff @@ -71,8 +83,8 @@ our $webdotdir = "$datadir/webdot"; ( admin => [qw(GetParamList UpdateParams SetParam WriteParams)], db => [qw($db_driver $db_host $db_port $db_name $db_user $db_pass $db_sock)], - locations => [qw($libpath $localconfig $attachdir - $datadir $templatedir $webdotdir)], + locations => [qw($libpath $localconfig $attachdir $datadir $templatedir + $webdotdir $project)], ); Exporter::export_ok_tags('admin', 'db', 'locations'); -- cgit v1.2.3-24-g4f1b