use Tree::Simple qw/use_weak_refs/;
use Tree::Simple::Visitor::FindByUID;
use attributes;
-use JSON;
+use YAML::Syck;
use File::Slurp;
__PACKAGE__->mk_accessors(
__PACKAGE__->config({ db => 'dsn:SQLite:foo.db' });
-You can also use a L<JSON> config file like myapp.json in your
+You can also use a L<YAML> 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} );
- # JSON config support
+ # YAML config support
my $confpath = $class->config->{file}
|| $class->path_to(
- ( Catalyst::Utils::appprefix( ref $class || $class ) . '.json' ) );
+ ( Catalyst::Utils::appprefix( ref $class || $class ) . '.yml' ) );
my $conf = {};
if ( -f $confpath ) {
my $content = read_file("$confpath");
- $conf = jsonToObj($content);
+ $conf = YAML::Syck::Load($content);
}
my $oldconf = $class->config;
$class->config( { %$oldconf, %$conf } );