NAME
Db::Mediasurface::ReadConfig - reads, parses, and stores configuration from a Mediasurface ms.properties file.
VERSION
This document refers to version 0.01 of DB::Mediasurface::ReadConfig, released August 3, 2001.
SYNOPSIS
use Db::Mediasurface::ReadConfig;
my $path = '/opt/ms/3.0.2/etc/ms.properties';
my $config = Db::Mediasurface::ReadConfig->new( path=>$path );
print('oracle user is '.$config->get_username."\n");
DESCRIPTION
Overview
When supplied with a path to a Mediasurface configuration file (usually called ms.properties), this module loads the configuration details into an object, which can be interrogated at a later time.
Constructor
- $config = Db::Mediasurface::ReadConfig->new( path=>$path );
-
This class method constructs a new configuration object by reading the file at location $path. This module assumes that the configuration file is constructed in the following manner...
Each key/value pair occurs on a single line, and the key and value are separated by an equals sign (=) and (optionally) white space. Any text on a line is ignored which follows a hash symbol (#).
Methods
- $value = $config->get_SOME_CONFIG_KEY;
-
Returns the value associated with a particular configuration key. If the key contained a full-stop in the config file, this is replaced by an underscore. For example, to get the value associated with jdbc.driver in the config file, use $config->get_jdbc_driver
- $config->set_SOME_CONFIG_KEY($value);
-
Sets the value of a given key. Does not write the value back to the config file - no permanent damage is done ;)
AUTHOR
Nigel Wetters (nwetters@cpan.org)
COPYRIGHT
Copyright (c) 2001, Nigel Wetters. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.