| Perlbug documentation | view source | Contained in the Perlbug distribution. |
Perlbug::Config - Perlbug Configuration data handler
Configuration data for the Perlbug bug tracking system.
Be sure to set the 'Perlbug_CONFIG' environment variable to the correct site configuration file, and/or fix the line at the top of this module.
Set methods are provided only for current() parameters, the rest are all gettable only, and settable only from the configuration file.
my $o_conf = Perlbug::Config->new($cfgfile);
my $format = $o_conf->current('format');
my $debug = $o_conf->current('debug');
Create new Config object with all prefs set.
my $conf = Perlbug::Config->new($cfg);
Redirect log output to STDOUT (if $Perlbug_DEBUG =~ /[dD]/
$o_conf->relog;
confess or cluck or carp, dependent on $Perlbug::(DEBUG|FATAL) settings
my $i_ok = $o_conf->error($err_msg);
Retrieve data from site configuration file
my ($ok, $h_data) = get_config_data($config_file_location);
Update config data structure for current/local environment
my ($ok, $h_data) = &update_data(\%data);
Set debug level, returns $o_conf, see Perlbug::Base::debug();
my $debug = $o_conf->set_debug(2);
Sets ENVIRONMENT and PACKAGE variables in config hash for reference
my $prefs = $o_conf->set_env($prefs);
Prime config data structure
my ($ok, $h_data) = prime_data(\%data);
Sets Perlbug alarm process so we don't go on for ever :-)
Certain utility methods are available against the configuration object
Returns common date for use throughout Perlbug.
my $date = get_date; # -> 19980815 - 20010728
Return list of Config keys of given key
my @keys = $o_conf->get_keys('current'); # have a look
Return list of Config values of given key
my @vals = $o_conf->get_vals('current'); # have a look
Return mapping of each Config key=val
print $o_conf->get_all('current'); # -> context=ascii ...
Return textual representation of config data
print $o_conf->get_config('system');
Accessor methods are provided for the following configuration data structures:
CURRENT SYSTEM DATABASE DIRECTORY TARGET FORWARD FEEDBACK MESSAGE EMAIL WEB DEFAULT GROUP SEVERITY STATUS VERSION
Retrieve the value:
my $user = $o_config->system('user');
my $target = $o_config->target('generic');
Note that current is the only one available for modification, and that it returns keys of succesful updates (note the hashref).
my $attr = $self->current('format'); # get one
my @keys = $self->current(); # get all
my $data = $self->current({'format' => 'h'}); # set $data = 'format'
my @data = $self->current( # set @data = qw(format context)
{'format' => 'a', 'context' => 'html'}
);
Richard Foley perlbug@rfi.net 1999 2000 2001
| Perlbug documentation | view source | Contained in the Perlbug distribution. |