X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FComponent.pm;h=0fbca47f77be75e5ac919289b0b6efce3dd8a19a;hp=2decf10dc9f7896882a4eef209da6f6a84a8a483;hb=1b79e1994c40fc525b4a84c900a5c95ffd4a2f8a;hpb=139b894c380e870c0b25ea20749cc6f689d93fa0 diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index 2decf10..0fbca47 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -60,6 +60,8 @@ component loader with config() support and a process() method placeholder. __PACKAGE__->mk_classdata('_plugins'); __PACKAGE__->mk_classdata('_config'); +has _component_name => ( is => 'ro' ); + sub BUILDARGS { my $class = shift; my $args = {}; @@ -85,19 +87,18 @@ sub BUILDARGS { } sub COMPONENT { - my ( $self, $c ) = @_; + my ( $class, $c ) = @_; # Temporary fix, some components does not pass context to constructor my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {}; - if( my $next = $self->next::can ){ - my $class = blessed $self || $self; + if ( my $next = $class->next::can ) { my ($next_package) = Class::MOP::get_code_info($next); warn "There is a COMPONENT method resolving after Catalyst::Component in ${next_package}.\n"; warn "This behavior can no longer be supported, and so your application is probably broken.\n"; warn "Your linearized isa hierarchy is: " . join(', ', @{ mro::get_linear_isa($class) }) . "\n"; warn "Please see perldoc Catalyst::Upgrading for more information about this issue.\n"; } - return $self->new($c, $arguments); + return $class->new($c, $arguments); } sub config {