Thorium::Conf - Configuration class
package Some::App::Conf; use Moose; extends 'Thorium::Conf'; has '+component_name' => ('default' => 'someapp'); has '+component' => ('default' => [ '/file1.yaml', '/file2.yaml' ]); 1;
But you may also use it directly:
use Thorium::Conf; my $conf = Thorium::Conf->new('from' => '/that/app.yaml'); print $conf->data('some.key'); ...
Data is accessed through a string interface that maps directly to the key names of a hash. Data is loaded in the order of (first to last): global, system, component, env_var, from. With each overriding data from the previous, e.g. component's a key would override systems's a key. All data is marked read-only to prevent accidental modification, but there is an interface to control this.
In nearly all cases you should sub-class and override the
component attributes. See the "SYNOPSIS" for an example.
component maps to the base file name that will be found in the
system location (as set by
_system_directory_root). Therefore, if your component name is
someapp, then you'd expect the system wide file to reside in /etc/thorium/conf/someapp.yaml.
/etc/thorium/conf/thorium.yaml is the universally global file all Thorium::Conf and sub-classed objects read (when it exists).
$key is specified, return that specific data, otherwise return all data.
Note: by default all configuration data is marked read only and can not be changed.
Re-reads all data from files.
Writes the data to the full file path from $filename.
Change $key to $value. $key is the same format as
Adam Flott <email@example.com>
This software is copyright (c) 2011 by Adam Flott <firstname.lastname@example.org>, CIDC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.