Catalyst::Plugin::ConfigLoader::Manual - Guide to using the ConfigLoader plugin
package MyApp; use Catalyst qw( ConfigLoader ... );
MYAPP_CONFIG - specific config file to load for "MyApp"
MYAPP_CONFIG
CATALYST_CONFIG_LOCAL_SUFFIX - global suffix for extra config files
CATALYST_CONFIG_LOCAL_SUFFIX
MYAPP_CONFIG_LOCAL_SUFFIX - suffix specifically for "MyApp"
MYAPP_CONFIG_LOCAL_SUFFIX
cnf
conf
name = TestApp <Component Controller::Foo> foo bar </Component> <Model Baz> qux xyzzy </Model>
ini
name=TestApp [Controller::Foo] foo=bar [Model::Baz] qux=xyzzy
jsn
json
{ "name": "TestApp", "Controller::Foo": { "foo": "bar" }, "Model::Baz": { "qux": "xyzzy" } }
pl
perl
{ name => 'TestApp', 'Controller::Foo' => { foo => 'bar' }, 'Model::Baz' => { qux => 'xyzzy' } }
xml
<config> <name>TestApp</name> <component name="Controller::Foo"> <foo>bar</foo> </component> <model name="Baz"> <qux>xyzzy</qux> </model> </config>
yml
yaml
--- name: TestApp Controller::Foo: foo: bar Model::Baz: qux: xyzzy
Model::MyModel: schema_class: MyApp::MySchema connect_info: - dbi:SQLite:myapp.db - '' - '' - AutoCommit: 1
As of Catalyst::Devel 1.07, a newly created application will use Config::General for configuration. If you wish to convert your existing config, run the following one-liner (replacing MyApp with your app's name):
perl -Ilib -MMyApp -MConfig::General -e 'Config::General->new->save_file("myapp.conf", MyApp->config);'
If you have UTF-8 strings in your Config::General-based config file, you should add the following config information to MyApp.pm:
__PACKAGE__->config( 'Plugin::ConfigLoader' => { driver => { 'General' => { -UTF8 => 1 }, } } );
To install Catalyst::Plugin::ConfigLoader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::ConfigLoader
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::ConfigLoader
For more information on module installation, please visit the detailed CPAN module installation guide.