sub components {
my ( $class, $comps ) = @_;
+ # FIXME
+ # this is very wrong
# people create components calling this sub directly, before setup
+ # also, $class->log doesn't work before setup_log
$class->setup_config unless $class->container;
my $container = $class->container;
if ( $comps ) {
+ $class->log->warn(q{You are adding components using Catalyst's components method.});
+ $class->log->warn(q{This behaviour is deprecated, please read});
+ $class->log->warn(q{Catalyst::IOC::Container's documentation for better ways to do that.});
$container->add_component( $_ ) for keys %$comps;
}
},
));
-TestAppComponents->components( {} );
-
# this is so TestAppComponents->container will work
TestAppComponents->setup_config;
# this is so TestAppComponents->log->warn will work
TestAppComponents->setup_log;
+TestAppComponents->components( {} );
+
my @comps = TestAppComponents->locate_components;
for my $component (@comps) {
__PACKAGE__->config( { disable_component_resolution_regex_fallback => 1 } );
- __PACKAGE__->components( { map { ( ref($_)||$_ , $_ ) }
- qw/MyApp::WithoutRegexFallback::Controller::Another::Foo/ } );
-
# allow $c->log->warn to work
__PACKAGE__->setup_log;
+
+ __PACKAGE__->components( { map { ( ref($_)||$_ , $_ ) }
+ qw/MyApp::WithoutRegexFallback::Controller::Another::Foo/ } );
}
{