\r
<config>\r
<name>TestApp</name>\r
- <component name="Controller::Config">\r
+ <component name="Controller::Foo">\r
<foo>bar</foo>\r
</component>\r
</config>\r
\r
=head1 METHODS\r
\r
+=head2 extensions( )\r
+\r
+return an array of valid extensions (C<xml>).\r
+\r
+=cut\r
+\r
+sub extensions {\r
+ return qw( xml );\r
+}\r
+\r
=head2 load( $file )\r
\r
Attempts to load C<$file> as an XML file.\r
=cut\r
\r
sub load {\r
- my $class = shift;\r
- my $confpath = shift;\r
-\r
- my $file;\r
- if( $confpath =~ /\.(.{3})$/ ) {\r
- return unless $1 eq 'xml';\r
- $file = $confpath;\r
- }\r
- else {\r
- $file = "$confpath.xml";\r
- }\r
- \r
- return unless -f $file;\r
+ my $class = shift;\r
+ my $file = shift;\r
\r
require XML::Simple;\r
XML::Simple->import;\r
- my $config = XMLin( $file, ForceArray => [ 'component' ] );\r
+ my $config = XMLin( $file, ForceArray => [ 'component' ] );\r
\r
my $components = delete $config->{ component };\r
foreach my $element ( keys %$components ) {\r
\r
=item * L<Catalyst>\r
\r
+=item * <Catalyst::Plugin::ConfigLoader>\r
+\r
=back\r
\r
=cut\r