X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FIOC%2FConstructorInjection.pm;h=dce5deff5fe0083d5db9b0f5990eb2476b85f3ce;hp=bed93552eddece36fc78c66f5a200dc34566b9a0;hb=96c9f5d4c9cebf815970a5ea94b90ad693ebaa93;hpb=6ac0784b4442b46abae68c76318c2189221e725d diff --git a/lib/Catalyst/IOC/ConstructorInjection.pm b/lib/Catalyst/IOC/ConstructorInjection.pm index bed9355..dce5def 100644 --- a/lib/Catalyst/IOC/ConstructorInjection.pm +++ b/lib/Catalyst/IOC/ConstructorInjection.pm @@ -44,12 +44,7 @@ sub get { my %config = (%{ $self->config || {} }, %{ $params }); $self->_clear_config; - # FIXME - Is depending on the application name to pass into constructors here a good idea? - # This makes app/ctx split harder I think.. Need to think more here, but I think - # we want to pass the application in as a parameter when building the service - # rather than depending on the app name, so that later, when the app becomes an instance - # then it'll get passed in, and components can stash themselves 'per app instance' - my $app_name = $self->param('application_name'); + my $app = $self->param('catalyst_application'); # Stash catalyst_component_name in the config here, so that custom COMPONENT # methods also pass it. @@ -62,7 +57,7 @@ sub get { my $instance; try { - $instance = $component->COMPONENT( $app_name, \%config ); + $instance = $component->COMPONENT( $app, \%config ); } catch { Catalyst::Exception->throw(