X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FConfigLoader%2FManual.pod;h=d0a13dd077f8e2edf10e4ff37d9f446abf506ac2;hb=883b81a06769e1c8061e576d2b0cc3b2b3b7320b;hp=e2f07bfd5d5ad9b4e5a70e6fdc7388828d6e395f;hpb=b134c74afc8721a18fe083e1a2b6b7608750baa9;p=catagits%2FCatalyst-Plugin-ConfigLoader.git diff --git a/lib/Catalyst/Plugin/ConfigLoader/Manual.pod b/lib/Catalyst/Plugin/ConfigLoader/Manual.pod index e2f07bf..d0a13dd 100644 --- a/lib/Catalyst/Plugin/ConfigLoader/Manual.pod +++ b/lib/Catalyst/Plugin/ConfigLoader/Manual.pod @@ -1,3 +1,4 @@ + =head1 NAME Catalyst::Plugin::ConfigLoader::Manual - Guide to using the ConfigLoader plugin @@ -124,15 +125,29 @@ Catalyst::Plugin::ConfigLoader::Manual - Guide to using the ConfigLoader plugin =head3 Example Config - - TestApp - - bar - - - xyzzy + + MyApp::CMS + + /var/www/docs/myapp-cms/uploads + + + dbi:mysql:cmsdb + user + password - + + __path_to(root,templates)__ + UTF-8 + 1 + 2 + 2 + + + + +Note that the name attribute for the C tag should be the relative +namespace of the Catalyst model, not the absolute one. That is for +C the C attribute should be C. =head2 YAML @@ -161,11 +176,64 @@ Catalyst::Plugin::ConfigLoader::Manual - Guide to using the ConfigLoader plugin Model::MyModel: schema_class: MyApp::MySchema - connect_info: + connect_info: - dbi:SQLite:myapp.db - '' - '' - AutoCommit: 1 +=head2 Converting your existing config to Config::General format + +As of L 1.07, a newly created application will use +L 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);' + +=head2 Using UTF-8 strings in a Config::General file + +If you have UTF-8 strings in your L-based config file, you +should add the following config information to MyApp.pm: + + __PACKAGE__->config( 'Plugin::ConfigLoader' => { + driver => { + 'General' => { -UTF8 => 1 }, + } + } ); + +=head2 Using a local configuration file + +When ConfigLoader reads configurations, it starts by reading the configuration +file for C with one of the supported extensions as listed +L. + +For example, A L config file is C. + +If a configuration file called C exists with one of the supported +file extensions, it will also be read, and values from that file will +override values from the main config file. + +A L local configuration file would be called +C. + +The C suffix can be changed. See +L for the details of +how. + +This is useful because it allows different people or environments to have +different configuration files. A project with three developers, +I, I, and I as well as a production environment can have +a C, a C, a C, and a +C. + +Each developer, and the web server, would set the environment variable +to load their proper configuration file. All of the configurations can +be stored properly in source control. + +If there is no C (where .ext is a supported extension), and +the individual configuration files contain something required to start the +application, such as the Model's data source definition, the applicaton won't +start unless the environment variable is set properly. + =cut