Config
The Config library finds the etc directory and reads the Assure1.conf file in JSON format.
Synopsis
my $config = new Assure1::Config();
# Find the path to an application
my $RunScript = $config->{BaseDir} . '/bin/RunScript';
# Save Event DB shard ID
$config->{DBShards}->{Event} = 3;
# Use a non-standard config file
my $config = Assure1::Config->new({ 'configPath' => '/path/to/Assure1-custom.conf' });
Setting the configPath option causes all future Assure1::Config instantiations to use that value as the default ConfigPath for the life of the process.
For example:
# will read in BASEDIR/etc/Assure1.conf
my $config1 = Assure1::Config->new();
# will read in /path/to/Assure1-custom.conf
my $config2 = Assure1::Config->new({ 'configPath' => '/path/to/Assure1-custom.conf' });
# will read in /path/to/Assure1-custom.conf because of custom configPath set for $config2 above
my $config3 = Assure1::Config->new();
# will read in /path/to/Assure1-another-custom.conf
my $config4 = Assure1::Config->new({ 'configPath' => '/path/to/Assure1-another-custom.conf' });