### ### Copyright 2000-2007 University of Illinois Board of Trustees ### All rights reserved. ### ### PSGConf::DataStore::ConfigFile - config file data store for psgconf ### ### Campus Information Technologies and Educational Services ### University of Illinois at Urbana-Champaign ### package PSGConf::DataStore::ConfigFile; use PSGConf::DataStore; use Config::Objective; use strict; our @ISA = qw(PSGConf::DataStore); ############################################################################### ### read config ############################################################################### sub read_config { my ($self, $psgconf) = @_; my ($file); ### ### This looks backwards, but using $psgconf first is so command ### line options for a config file get processed before a default ### from the class creation. ### $file = (defined($psgconf->{'config_file'}) ? $psgconf->{'config_file'} : $self->{'config_file'}); Config::Objective->new( $file, $psgconf->{'data'}, 'include_dir' => $psgconf->{'config_dir'} ) || die $0 . ": cannot read config file '$file'\n"; } ############################################################################### ### documentation ############################################################################### 1; __END__ =head1 NAME PSGConf::DataStore::ConfigFile - config file data store class for psgconf =head1 SYNOPSIS In F: DataStore PSGConf::DataStore::ConfigFile config_file=/etc/psg.conf =head1 DESCRIPTION The B module provides a data store implementation that reads configuration information from a local config file (typically F). It supports the following methods: =over 4 =item new() The constructor. Its arguments are a reference to the B object and an optional list of attribute settings in the form "attribute=value". The following attributes are supported: =over 4 =item I The absolute path to the default config file location. This value is overriden by the I attribute of the B object. =back =item read_config() Reads the config file. Its argument is a reference to the B object. =back The config file parser is implemented using B. See L for details on the config file format. =head1 SEE ALSO L L L L =cut