summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-20 05:15:17 +0200
committerlpsolit%gmail.com <>2006-06-20 05:15:17 +0200
commit2545c0950c4f0fde8f78b265217fa9f523eff7bf (patch)
tree5bb305644ad11da196c7613b82743e426e2fd337 /Bugzilla/Config.pm
parentb687ddef9b6dfeec3d87b7ae211decbf21b6e9a9 (diff)
downloadbugzilla-2545c0950c4f0fde8f78b265217fa9f523eff7bf.tar.gz
bugzilla-2545c0950c4f0fde8f78b265217fa9f523eff7bf.tar.xz
Bug 304601: Bugzilla::Config's :locations exports need to be in their own module - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat for the main patch, r=myk for the patch about CGI.pm a=justdave
Bug 328637: Remove all legal_* versioncache arrays - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave Bug 110503 - Eliminate versioncache
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r--Bugzilla/Config.pm27
1 files changed, 15 insertions, 12 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm
index a04bbfe8c..3f5b788c2 100644
--- a/Bugzilla/Config.pm
+++ b/Bugzilla/Config.pm
@@ -112,19 +112,20 @@ use vars qw(@param_list);
do $localconfig;
my %params;
# Load in the param definitions
-foreach my $item ((glob "$libpath/Bugzilla/Config/*.pm")) {
- $item =~ m#/([^/]+)\.pm$#;
- my $module = $1;
- next if ($module eq 'Common');
- require "Bugzilla/Config/$module.pm";
- my @new_param_list = "Bugzilla::Config::$module"->get_param_list();
- foreach my $item (@new_param_list) {
- $params{$item->{'name'}} = $item;
+sub _load_params {
+ foreach my $item ((glob "$libpath/Bugzilla/Config/*.pm")) {
+ $item =~ m#/([^/]+)\.pm$#;
+ my $module = $1;
+ next if ($module eq 'Common');
+ require "Bugzilla/Config/$module.pm";
+ my @new_param_list = "Bugzilla::Config::$module"->get_param_list();
+ foreach my $item (@new_param_list) {
+ $params{$item->{'name'}} = $item;
+ }
+ push(@parampanels, $module);
+ push(@param_list, @new_param_list);
}
- push(@parampanels, $module);
- push(@param_list, @new_param_list);
}
-
# END INIT CODE
# Subroutines go here
@@ -132,6 +133,7 @@ foreach my $item ((glob "$libpath/Bugzilla/Config/*.pm")) {
sub Param {
my ($param) = @_;
+ _load_params unless %params;
my %param_values = %{Bugzilla->params};
# By this stage, the param must be in the hash
@@ -153,6 +155,7 @@ sub Param {
sub SetParam {
my ($name, $value) = @_;
+ _load_params unless %params;
die "Unknown param $name" unless (exists $params{$name});
my $entry = $params{$name};
@@ -176,7 +179,6 @@ sub UpdateParams {
# Note that this isn't particularly 'clean' in terms of separating
# the backend code (ie this) from the actual params.
# We don't care about that, though
-
my $param = Bugzilla->params;
# Old Bugzilla versions stored the version number in the params file
@@ -239,6 +241,7 @@ sub UpdateParams {
# --- DEFAULTS FOR NEW PARAMS ---
+ _load_params unless %params;
foreach my $item (@param_list) {
my $name = $item->{'name'};
$param->{$name} = $item->{'default'} unless exists $param->{$name};