attempt at locate_components backcompat
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 0cd35b0..b7a2c77 100644 (file)
@@ -2320,10 +2320,27 @@ sub setup_components {
     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.