This file documents the revision history for Perl extension Catalyst.
5.62
+ - Added YAML config support
- Added COMPONENT() and ACCEPT_CONTEXT() support
- Action list in debug mode is now displayed as a tree in the
correct execution order.
requires 'URI' => 1.35;
requires 'File::Copy::Recursive';
requires 'Module::Install::Admin' => '0.45';
+requires 'YAML';
feature 'Apache/mod_perl Support',
-default => 0,
use Tree::Simple qw/use_weak_refs/;
use Tree::Simple::Visitor::FindByUID;
use attributes;
+use YAML ();
__PACKAGE__->mk_accessors(
qw/counter request response state action stack namespace/
}
}
+ $class->setup_home( delete $flags->{home} );
+
+ # YAML config support
+ my $confpath =
+ $class->path_to(
+ Catalyst::Utils::appprefix( ref $class || $class ) . '.yml' );
+ my $conf = {};
+ $conf = YAML::LoadFile($confpath) if -f $confpath;
+ my $oldconf = $class->config;
+ $class->config( { %$oldconf, %$conf } );
+
$class->setup_log( delete $flags->{log} );
$class->setup_plugins( delete $flags->{plugins} );
$class->setup_dispatcher( delete $flags->{dispatcher} );
$class->setup_engine( delete $flags->{engine} );
- $class->setup_home( delete $flags->{home} );
for my $flag ( sort keys %{$flags} ) {
if ($gen_app) {
$self->_mk_dirs;
+ $self->_mk_config;
$self->_mk_appclass;
$self->_mk_readme;
$self->_mk_changes;
}
}
+sub _mk_config {
+ my $self = shift;
+ my $dir = $self->{dir};
+ my $appprefix = $self->{appprefix};
+ $self->render_file( 'config',
+ File::Spec->catfile( $dir, "$appprefix.yml" ) );
+}
+
sub _mk_readme {
my $self = shift;
my $dir = $self->{dir};
our $VERSION = '0.01';
#
-# Configure the application
-#
-__PACKAGE__->config( name => '[% name %]' );
-
-#
# Start the application
#
__PACKAGE__->setup;
install_script glob('script/*.pl');
auto_install;
WriteAll;
+__config__
+---
+name: [% name %]
__readme__
Run script/[% appprefix %]_server.pl to test the application.
__changes__