X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FBase.pm;h=ec25476b1b70be7a35ff129bd0f34eaba48c71fa;hb=4f6748f101647dd3344339b19510947df6836412;hp=597bca755ac7ba736eea5657000c988fa5342259;hpb=5202412817c039439a537f11fb5b78a0b8b80955;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Base.pm b/lib/Catalyst/Base.pm index 597bca7..ec25476 100644 --- a/lib/Catalyst/Base.pm +++ b/lib/Catalyst/Base.pm @@ -2,11 +2,12 @@ package Catalyst::Base; use strict; use base qw/Class::Data::Inheritable Class::Accessor::Fast/; +use Catalyst::Utils; use NEXT; __PACKAGE__->mk_classdata($_) for qw/_attrcache _cache _config/; -__PACKAGE__->_cache( [] ); __PACKAGE__->_attrcache( {} ); +__PACKAGE__->_cache( [] ); # note - see attributes(3pm) sub MODIFY_CODE_ATTRIBUTES { @@ -69,7 +70,12 @@ component loader with config() support and a process() method placeholder. sub new { my ( $self, $c ) = @_; - return $self->NEXT::new( $self->config ); + my $class = ref $self || $self; + my $appname = Catalyst::Utils::class2appclass($class); + my $suffix = Catalyst::Utils::class2classsuffix($class); + my $appconfig = $appname->config->{$suffix} || {}; + my $config = { %{ $self->config }, %{$appconfig} }; + return $self->NEXT::new($config); } # remember to leave blank lines between the consecutive =item's