From 9d96ac724457e849dcc01c9fb1b87128a6b75e05 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 4 Sep 2006 02:18:53 +0000 Subject: Bug 347096: Create Bugzilla->localconfig and replace most read_localconfig calls with it Patch By Max Kanat-Alexander r=LpSolit, a=myk --- Bugzilla/Install/Filesystem.pm | 4 ++-- Bugzilla/Install/Localconfig.pm | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Install') diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 9ba8fcd1b..02131531c 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -59,7 +59,7 @@ sub FILESYSTEM { my $templatedir = bz_locations()->{'templatedir'}; my $libdir = bz_locations()->{'libpath'}; - my $ws_group = read_localconfig()->{'webservergroup'}; + my $ws_group = Bugzilla->localconfig->{'webservergroup'}; # The set of permissions that we use: @@ -494,7 +494,7 @@ sub fix_all_file_permissions { my $owner_id = POSIX::getuid(); my $group_id = POSIX::getgid(); - my $ws_group = read_localconfig()->{'webservergroup'}; + my $ws_group = Bugzilla->localconfig->{'webservergroup'}; if ($ws_group) { my $ws_group_id = getgrnam($ws_group); die "There is no such group: $ws_group. Check your \$webservergroup" diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index ef5605d41..f01be8bf9 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -33,11 +33,9 @@ use IO::File; use Safe; use base qw(Exporter); -our @EXPORT = qw( - read_localconfig -); our @EXPORT_OK = qw( + read_localconfig update_localconfig ); @@ -344,6 +342,9 @@ EOT # Now we do some checks on localconfig values. _check_web_server_group($localconfig->{'webservergroup'}) if $output; + # Reset the cache for Bugzilla->localconfig so that it will be re-read + delete Bugzilla->request_cache->{localconfig}; + return { old_vars => \@old_vars, new_vars => \@new_vars }; } @@ -460,14 +461,14 @@ Bugzilla::Install::Localconfig - Functions and variables dealing =head1 SYNOPSIS - use Bugzilla::Install::Requirements qw(read_localconfig update_localconfig) - my $localconfig = read_localconfig(); + use Bugzilla::Install::Requirements qw(update_localconfig); update_localconfig({ output => 1, answer => \%answer }); =head1 DESCRIPTION This module is used primarily by L to create and -modify the localconfig file. +modify the localconfig file. Most scripts should use L +to access localconfig variables. =head1 CONSTANTS -- cgit v1.2.3-24-g4f1b