
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"CATALYST_CONFIG_LOCAL_SUFFIX - global suffix for extra config filesMYAPP_CONFIG_LOCAL_SUFFIX - suffix specifically for "MyApp"
name = TestApp
<Component Controller::Foo>
foo bar
</Component>
<Model Baz>
qux xyzzy
</Model>
name=TestApp
[Controller::Foo]
foo=bar
[Model::Baz]
qux=xyzzy
{
"name": "TestApp",
"Controller::Foo": {
"foo": "bar"
},
"Model::Baz": {
"qux": "xyzzy"
}
}
{
name => 'TestApp',
'Controller::Foo' => {
foo => 'bar'
},
'Model::Baz' => {
qux => 'xyzzy'
}
}
<config>
<name>TestApp</name>
<component name="Controller::Foo">
<foo>bar</foo>
</component>
<model name="Baz">
<qux>xyzzy</qux>
</model>
</config>
---
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 },
}
} );