This file documents the revision history for Perl extension Catalyst.
+5.64
+
+ - Switched to JSON from YAML for the default config file
+
5.63
- Updated prereq versions
requires 'URI' => 1.35;
requires 'File::Copy::Recursive';
requires 'Module::Install::Admin' => '0.54';
-requires 'Module::Install' => '0.54';
-requires 'YAML' => '0.52';
+requires 'Module::Install' => '0.54';
+requires 'JSON';
+requires 'File::Slurp';
feature 'Apache/mod_perl Support',
-default => 0,
use Tree::Simple qw/use_weak_refs/;
use Tree::Simple::Visitor::FindByUID;
use attributes;
-use YAML ();
+use JSON;
+use File::Slurp;
__PACKAGE__->mk_accessors(
qw/counter request response state action stack namespace/
__PACKAGE__->config({ db => 'dsn:SQLite:foo.db' });
-You can also use a L<YAML> config file like myapp.yml in your
+You can also use a L<JSON> config file like myapp.json in your
applications home directory.
- ---
- db: dsn:SQLite:foo.db
+ {
+ "db": "dsn:SQLite:foo.db"
+ }
=head2 $c->debug
$class->setup_home( delete $flags->{home} );
- # YAML config support
+ # JSON config support
my $confpath = $class->config->{file}
|| $class->path_to(
- ( Catalyst::Utils::appprefix( ref $class || $class ) . '.yml' ) );
+ ( Catalyst::Utils::appprefix( ref $class || $class ) . '.json' ) );
my $conf = {};
- $conf = YAML::LoadFile($confpath) if -f $confpath;
+ if ( -f $confpath ) {
+ my $content = read_file("$confpath");
+ $conf = jsonToObj($content);
+ }
my $oldconf = $class->config;
$class->config( { %$oldconf, %$conf } );
my $dir = $self->{dir};
my $appprefix = $self->{appprefix};
$self->render_file( 'config',
- File::Spec->catfile( $dir, "$appprefix.yml" ) );
+ File::Spec->catfile( $dir, "$appprefix.json" ) );
}
sub _mk_readme {
auto_install;
WriteAll;
__config__
----
-name: [% name %]
+{
+ "name": "[% name %]"
+}
__readme__
Run script/[% appprefix %]_server.pl to test the application.
__changes__
my $keepalive = 0;
my $restart = 0;
my $restart_delay = 1;
-my $restart_regex = '\.yml$|\.yaml$|\.pm$';
+my $restart_regex = '\.yml$|\.yaml$|\.json|\.pm$';
my @argv = @ARGV;
-rd -restartdelay delay between file checks
-rr -restartregex regex match files that trigger
a restart when modified
- (defaults to '\.yml$|\.yaml$|\.pm$')
+ (defaults to '\.yml$|\.yaml$|\.json|\.pm$')
See also:
perldoc Catalyst::Manual