Commit | Line | Data |
---|---|---|
affbca23 | 1 | =head1 NAME |
2 | ||
3 | Catalyst::Plugin::ConfigLoader::Manual - Guide to using the ConfigLoader plugin | |
4 | ||
5 | =head1 BASIC USAGE | |
6 | ||
7 | package MyApp; | |
8 | ||
9 | use Catalyst qw( ConfigLoader ... ); | |
10 | ||
bc40ee17 | 11 | =head1 ENVIRONMENT VARIABLES |
12 | ||
13 | =over 4 | |
14 | ||
15 | =item * C<MYAPP_CONFIG> - specific config file to load for "MyApp" | |
16 | ||
17 | =item * C<CATALYST_CONFIG_LOCAL_SUFFIX> - global suffix for extra config files | |
18 | ||
19 | =item * C<MYAPP_CONFIG_LOCAL_SUFFIX> - suffix specifically for "MyApp" | |
20 | ||
21 | =back | |
22 | ||
affbca23 | 23 | =head1 CONFIG FORMATS |
24 | ||
25 | =head2 Config::General | |
26 | ||
0365c42f | 27 | =head3 Extensions |
28 | ||
29 | =over 4 | |
30 | ||
31 | =item * cnf | |
32 | ||
33 | =item * conf | |
34 | ||
35 | =back | |
36 | ||
37 | =head3 Example Config | |
38 | ||
affbca23 | 39 | name = TestApp |
40 | <Component Controller::Foo> | |
41 | foo bar | |
42 | </Component> | |
43 | <Model Baz> | |
44 | qux xyzzy | |
45 | </Model> | |
46 | ||
47 | =head2 INI | |
48 | ||
0365c42f | 49 | =head3 Extensions |
50 | ||
51 | =over 4 | |
52 | ||
53 | =item * ini | |
54 | ||
55 | =back | |
56 | ||
57 | =head3 Example Config | |
58 | ||
affbca23 | 59 | name=TestApp |
60 | ||
61 | [Controller::Foo] | |
62 | foo=bar | |
63 | ||
64 | [Model::Baz] | |
65 | qux=xyzzy | |
66 | ||
67 | =head2 JSON | |
68 | ||
0365c42f | 69 | =head3 Extensions |
70 | ||
71 | =over 4 | |
72 | ||
73 | =item * jsn | |
74 | ||
75 | =item * json | |
76 | ||
77 | =back | |
78 | ||
79 | =head3 Example Config | |
80 | ||
affbca23 | 81 | { |
82 | "name": "TestApp", | |
83 | "Controller::Foo": { | |
84 | "foo": "bar" | |
85 | }, | |
86 | "Model::Baz": { | |
87 | "qux": "xyzzy" | |
88 | } | |
89 | } | |
90 | ||
91 | =head2 Perl | |
92 | ||
0365c42f | 93 | =head3 Extensions |
94 | ||
95 | =over 4 | |
96 | ||
97 | =item * pl | |
98 | ||
99 | =item * perl | |
100 | ||
101 | =back | |
102 | ||
103 | =head3 Example Config | |
104 | ||
affbca23 | 105 | { |
106 | name => 'TestApp', | |
107 | 'Controller::Foo' => { | |
108 | foo => 'bar' | |
109 | }, | |
110 | 'Model::Baz' => { | |
111 | qux => 'xyzzy' | |
112 | } | |
113 | } | |
114 | ||
115 | =head2 XML | |
116 | ||
0365c42f | 117 | =head3 Extensions |
118 | ||
119 | =over 4 | |
120 | ||
121 | =item * xml | |
122 | ||
123 | =back | |
124 | ||
125 | =head3 Example Config | |
126 | ||
affbca23 | 127 | <config> |
128 | <name>TestApp</name> | |
129 | <component name="Controller::Foo"> | |
130 | <foo>bar</foo> | |
131 | </component> | |
132 | <model name="Baz"> | |
133 | <qux>xyzzy</qux> | |
134 | </model> | |
135 | </config> | |
136 | ||
137 | =head2 YAML | |
138 | ||
0365c42f | 139 | =head3 Extensions |
140 | ||
141 | =over 4 | |
142 | ||
143 | =item * yml | |
144 | ||
145 | =item * yaml | |
146 | ||
147 | =back | |
148 | ||
149 | =head3 Example Config | |
150 | ||
affbca23 | 151 | --- |
152 | name: TestApp | |
153 | Controller::Foo: | |
154 | foo: bar | |
155 | Model::Baz: | |
156 | qux: xyzzy | |
157 | ||
b134c74a | 158 | =head1 COOKBOOK |
159 | ||
160 | =head2 Configuring a Catalyst::Model::DBIC::Schema model from a YAML config | |
161 | ||
162 | Model::MyModel: | |
163 | schema_class: MyApp::MySchema | |
164 | connect_info: | |
165 | - dbi:SQLite:myapp.db | |
166 | - '' | |
167 | - '' | |
168 | - AutoCommit: 1 | |
169 | ||
affbca23 | 170 | =cut |
b134c74a | 171 |