Bugzilla::Install::Localconfig

<<

#

- NAME
- SYNOPSIS
- DESCRIPTION
- CONSTANTS
- SUBROUTINES

# NAME

Bugzilla::Install::Localconfig - Functions and variables dealing with the manipulation and creation of the localconfig file.

# SYNOPSIS

     use Bugzilla::Install::Requirements qw(update_localconfig);
     update_localconfig({ output => 1 });

# DESCRIPTION

This module is used primarily by checksetup.pl to create and modify the localconfig file. Most scripts should use "localconfig" in Bugzilla to access localconfig variables.

# 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. If `update_localconfig` finds these variables defined in localconfig, it will print out a warning.

# 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 in `LOCALCONFIG_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 in `LOCALCONFIG_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.

<<