5.7.43. Bugzilla::Install::Localconfig¶
5.7.43.1. NAME¶
- Bugzilla::Install::Localconfig - Functions and variables dealing
- with the manipulation and creation of the localconfig file.
5.7.43.2. SYNOPSIS¶
use Bugzilla::Install::Requirements qw(update_localconfig);
update_localconfig({ output => 1 });
5.7.43.3. DESCRIPTION¶
This module is used primarily by checksetup.pl to create and modify the localconfig file. Most scripts should use Bugzilla/localconfig to access localconfig variables.
5.7.43.4. CONSTANTS¶
LOCALCONFIG_VARS
An array of hashrefs. These hashrefs contain three keys:
name - The name of the variable. default - The default value for the variable. Should always be something that can fit in a scalar. desc - Additional text to put in localconfig before the variable definition. Must end in a newline. Each line should start with "#" unless you have some REALLY good reason not to do that.
OLD_LOCALCONFIG_VARS
An array of names of variables. Ifupdate_localconfig
finds these variables defined in localconfig, it will print out a warning.
5.7.43.5. SUBROUTINES¶
read_localconfig
Description
Reads the localconfig file and returns all valid values in a hashref.Params
$include_deprecated
true
if you want the returned hashref to include *any* variable currently defined in localconfig, even if it doesn't exist inLOCALCONFIG_VARS
. Generally this is is only for use by `update_localconfig`_.Returns
A hashref of the localconfig variables. If an array is defined in localconfig, it will be an arrayref in the returned hash. If a hash is defined, it will be a hashref in the returned hash. Only includes variables specified inLOCALCONFIG_VARS
, unless$include_deprecated
is true.
update_localconfig
- Description: Adds any new variables to localconfig that aren't
- currently defined there. Also optionally prints out a message about vars that *should* be there and aren't. Exits the program if it adds any new vars.
- Params:
$output
-true
if the function should display informational- output and warnings. It will always display errors or any message which would cause program execution to halt.
- Returns: A hashref, with
old_vals
being an array of names of variables- that were removed, and
new_vals
being an array of names of variables that were added to localconfig.
This documentation undoubtedly has bugs; if you find some, please file them here.