From: André Walker Date: Thu, 28 Jul 2011 22:35:36 +0000 (-0300) Subject: attempt at locate_components backcompat X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b47ed80b909d640fb43a041d2c3de135119bad2c attempt at locate_components backcompat --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 0cd35b0..b7a2c77 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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. diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index 396e756..85624a3 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -396,10 +396,7 @@ sub build_locate_components_service { %$config ); - # XXX think about ditching this sort entirely - my @comps = sort { length $a <=> length $b } $locator->plugins; - - return \@comps; + return [ $locator->plugins ]; }, dependencies => [ depends_on('application_name'), depends_on('config') ], );