X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=5a91f46a92299f68f6de8ece7cba7333b465d217;hb=c0f74851f0f37dd24be65f03ad29f71fb642db99;hp=00e62faa7590cafa889b9543da282d21e9e1d49f;hpb=df912746b14abdadf70ae982f4b79ab459f08377;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 00e62fa..5a91f46 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -21,7 +21,7 @@ use Scalar::Util qw/weaken/; 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( @@ -449,12 +449,11 @@ Returns or takes a hashref containing the application's configuration. __PACKAGE__->config({ db => 'dsn:SQLite:foo.db' }); -You can also use a L config file like myapp.json in your +You can also use a L config file like myapp.json in your applications home directory. - { - "db": "dsn:SQLite:foo.db" - } + --- + db: dsn:SQLite:foo.db =head2 $c->debug @@ -592,14 +591,14 @@ sub setup { $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 } );