Catalyst::Plugin::ConfigLoader::Etc - Load etc config files
package MyApp; use Catalyst qw/ConfigLoader::Etc/; __PACKAGE__->config( 'Plugin::ConfigLoader::Etc' => { files => [ "$FindBin::Bin/etc/conf/test1.yml", ] } ); In the file, assuming it's in YAML format: foo: bar Accessible through the context object, or the class itself $c->config->{foo} # bar MyApp->config->{foo} # bar
config via env, for instance, $ENV{APPNAME_CONFIG_ETC} = "$FindBin::Bin/etc/conf/local.yml"; config('Plugin::ConfigLoader::Etc' => { files => [ '/path/to/config_file', '/path/to/xx_config' ] }
This method determines the potential file paths to be used for config loading It returns an array of paths (up to the filename less the extension), It is then passed to Catalyst::Plugin::ConfigLoader for actual configuration loading and processing.
Loading custom config files
zdk (Warachet Samtalee), <zdk at cpan.org>
<zdk at cpan.org>
Copyright 2012 zdk (Warachet Samtalee), all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
If you'd like to use it under a different license, that's probably OK. Please contact the author.
To install Catalyst::Plugin::ConfigLoader::Etc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::ConfigLoader::Etc
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::ConfigLoader::Etc
For more information on module installation, please visit the detailed CPAN module installation guide.