if (
$class->debug and
- my @comps_types = $class->container->get_components_types
+ my @comps_names_types = $class->container->get_components_names_types
) {
my $column_width = Catalyst::Utils::term_width() - 8 - 9;
my $t = Text::SimpleTable->new( [ $column_width, 'Class' ], [ 8, 'Type' ] );
- $t->row( @$_ ) for @comps_types;
+ $t->row( @$_ ) for @comps_names_types;
$class->log->debug( "Loaded components:\n" . $t->draw . "\n" );
}
my $container = $class->container;
if ( $comps ) {
- $container->add_component(
- $_, $class
- ) for keys %$comps;
+ $container->add_component( $_ ) for keys %$comps;
}
return $container->get_all_components();
=cut
sub setup_components {
- my $class = shift;
- # FIXME - I believe I shouldn't be handing $class over
- # Just don't know how to solve this.
- return $class->container->setup_components( $class );
+ shift->container->setup_components();
}
+=head2 locate_components
+
+=cut
+
# FIXME - removed locate_components
# don't people mess with this method directly?
# what to do with that?
+sub locate_components {
+ my $class = shift;
+
+ $class->log->warn('The locate_components method has been deprecated.');
+ $class->log->warn('Please read Catalyst::IOC::Container documentation to');
+ $class->log->warn('update your application.');
+
+ # XXX think about ditching this sort entirely
+ return sort { length $a <=> length $b }
+ @{ $class->container->resolve( service => 'locate_components' ) };
+}
+
+
=head2 $c->setup_dispatcher
Sets up dispatcher.